summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Gui/app.c1
-rw-r--r--Gui/app.h1
-rw-r--r--Gui/interface.c23
-rw-r--r--Gui/interface.h9
-rw-r--r--Gui/mplayer/mw.h39
-rw-r--r--Gui/mplayer/play.c17
-rw-r--r--Gui/skin/skin.c1
-rw-r--r--mplayer.c49
8 files changed, 68 insertions, 72 deletions
diff --git a/Gui/app.c b/Gui/app.c
index 4eb0b371d3..726eba5db8 100644
--- a/Gui/app.c
+++ b/Gui/app.c
@@ -38,7 +38,6 @@ void appClearItem( wItem * item )
item->fontid=0;
if ( item->label ) free( item->label ); item->label=NULL;
item->event=0;
- item->used=0;
}
void appCopy( listItems * dest,listItems * source )
diff --git a/Gui/app.h b/Gui/app.h
index 16320f418b..ab14d46b5a 100644
--- a/Gui/app.h
+++ b/Gui/app.h
@@ -34,7 +34,6 @@ typedef struct
int pressed,disabled,tmp;
int key,key2;
int phases;
- int used;
float value;
txSample Bitmap;
txSample Mask;
diff --git a/Gui/interface.c b/Gui/interface.c
index 376a8ef056..a00fdf3f41 100644
--- a/Gui/interface.c
+++ b/Gui/interface.c
@@ -14,6 +14,7 @@
#include "app.h"
#include "../libvo/x11_common.h"
#include "../input/input.h"
+#include "../libmpdemux/stream.h"
guiInterface_t guiIntfStruct;
@@ -46,6 +47,7 @@ int guiCMDArray[] =
void guiGetEvent( int type,char * arg )
{
+ dvd_priv_t * dvdp = (dvd_priv_t *) arg;
switch ( type )
{
case guiXEvent:
@@ -60,6 +62,27 @@ void guiGetEvent( int type,char * arg )
case guiSetPause: guiIntfStruct.Playing=2; mplState(); break;
}
break;
+ case guiSetState:
+ mplState();
+ break;
+ case guiSetFileName:
+ if ( arg ) guiSetFilename( guiIntfStruct.Filename,arg );
+ break;
+#ifdef USE_DVDREAD
+ case guiSetDVD:
+ guiIntfStruct.DVD.titles=dvdp->vmg_file->tt_srpt->nr_of_srpts;
+ guiIntfStruct.DVD.chapters=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
+ guiIntfStruct.DVD.angles=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
+ guiIntfStruct.DVD.nr_of_audio_channels=dvdp->nr_of_channels;
+ memcpy( guiIntfStruct.DVD.audio_streams,dvdp->audio_streams,sizeof( dvdp->audio_streams ) );
+ guiIntfStruct.DVD.nr_of_subtitles=dvdp->nr_of_subtitles;
+ memcpy( guiIntfStruct.DVD.subtitles,dvdp->subtitles,sizeof( dvdp->subtitles ) );
+ guiIntfStruct.DVD.current_title=dvd_title + 1;
+ guiIntfStruct.DVD.current_chapter=dvd_chapter + 1;
+ guiIntfStruct.DVD.current_angle=dvd_angle + 1;
+ guiIntfStruct.Track=dvd_title + 1;
+ break;
+#endif
#ifdef HAVE_NEW_INPUT
case guiIEvent:
printf( "cmd: %d\n",(int)arg );
diff --git a/Gui/interface.h b/Gui/interface.h
index 612babfdfc..d7a1a4b006 100644
--- a/Gui/interface.h
+++ b/Gui/interface.h
@@ -93,9 +93,12 @@ typedef struct
extern guiInterface_t guiIntfStruct;
-#define guiXEvent 0
-#define guiCEvent 1
-#define guiIEvent 2
+#define guiXEvent 0
+#define guiCEvent 1
+#define guiIEvent 2
+#define guiSetDVD 3
+#define guiSetFileName 4
+#define guiSetState 5
#define guiSetStop 0
#define guiSetPlay 1
diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h
index 9f334dd2a2..6495520fa3 100644
--- a/Gui/mplayer/mw.h
+++ b/Gui/mplayer/mw.h
@@ -200,6 +200,7 @@ drawrenderedtext:
extern void exit_player(char* how);
extern int audio_id;
extern int dvdsub_id;
+extern char * dvd_device;
void mplEventHandling( int msg,float param )
{
@@ -214,16 +215,16 @@ void mplEventHandling( int msg,float param )
#ifdef USE_DVDREAD
case evPlayDVD:
- dvd_title=1;
- dvd_chapter=1;
- dvd_angle=1;
+ guiIntfStruct.DVD.current_title=1;
+ guiIntfStruct.DVD.current_chapter=1;
+ guiIntfStruct.DVD.current_angle=1;
play_dvd_2:
guiIntfStruct.StreamType=STREAMTYPE_DVD;
#endif
case evPlay:
case evPlaySwitchToPause:
mplMainAutoPlay=0;
- if ( ( msg == evPlaySwitchToPause )&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
+ if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
switch ( guiIntfStruct.StreamType )
{
@@ -234,7 +235,12 @@ play_dvd_2:
break;
#ifdef USE_DVDREAD
case STREAMTYPE_DVD:
- guiSetFilename( guiIntfStruct.Filename,"/dev/dvd" );
+ if ( !dvd_device ) dvd_device=DEFAULT_DVD_DEVICE;
+ guiSetFilename( guiIntfStruct.Filename,dvd_device );
+ dvd_title=guiIntfStruct.DVD.current_title;
+ dvd_angle=guiIntfStruct.DVD.current_angle;
+ dvd_chapter=guiIntfStruct.DVD.current_chapter;
+ guiIntfStruct.DVDChanged=1;
break;
#endif
}
@@ -244,32 +250,20 @@ play_dvd_2:
#ifdef USE_DVDREAD
case evSetDVDSubtitle:
dvdsub_id=(int)param;
- dvd_title=guiIntfStruct.DVD.current_title;
- dvd_angle=guiIntfStruct.DVD.current_angle;
- dvd_chapter=guiIntfStruct.DVD.current_chapter;
- guiIntfStruct.DVDChanged=1;
goto play_dvd_2;
break;
case evSetDVDAudio:
audio_id=(int)param;
- dvd_title=guiIntfStruct.DVD.current_title;
- dvd_angle=guiIntfStruct.DVD.current_angle;
- dvd_chapter=guiIntfStruct.DVD.current_chapter;
- guiIntfStruct.DVDChanged=1;
goto play_dvd_2;
break;
case evSetDVDChapter:
- dvd_title=guiIntfStruct.DVD.current_title;
- dvd_angle=guiIntfStruct.DVD.current_angle;
- dvd_chapter=(int)param;
- guiIntfStruct.DVDChanged=1;
+ guiIntfStruct.DVD.current_chapter=(int)param;
goto play_dvd_2;
break;
case evSetDVDTitle:
- dvd_title=(int)param;
- dvd_chapter=1;
- dvd_angle=1;
- guiIntfStruct.DVDChanged=1;
+ guiIntfStruct.DVD.current_title=(int)param;
+ guiIntfStruct.DVD.current_chapter=1;
+ guiIntfStruct.DVD.current_angle=1;
goto play_dvd_2;
break;
#endif
@@ -439,7 +433,6 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
item=&appMPlayer.Items[SelectedItem];
itemtype=item->type;
item->pressed=btnPressed;
- item->used=1;
switch( item->type )
{
case itButton:
@@ -461,7 +454,6 @@ void mplMainMouseHandle( int Button,int X,int Y,int RX,int RY )
{
case itPotmeter:
case itHPotmeter:
- item->used=0;
btnModify( item->msg,(float)( X - item->x ) / item->width * 100.0f );
switch ( item->msg )
{
@@ -489,7 +481,6 @@ rollerhandled:
item=&appMPlayer.Items[currentselected];
if ( ( item->type == itHPotmeter )||( item->type == itVPotmeter )||( item->type == itPotmeter ) )
{
- item->used=0;
item->value+=value;
btnModify( item->msg,item->value );
switch ( item->msg )
diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c
index 0155c91ae2..4442e88380 100644
--- a/Gui/mplayer/play.c
+++ b/Gui/mplayer/play.c
@@ -9,6 +9,7 @@
#include "../../config.h"
#include "../../help_mp.h"
#include "../../libvo/x11_common.h"
+#include "../../input/input.h"
#include "../app.h"
@@ -65,13 +66,13 @@ void mplStop()
guiIntfStruct.TimeSec=0;
guiIntfStruct.Position=0;
guiIntfStruct.AudioType=0;
+ mplState();
// if ( !guiIntfStruct.Playing ) return;
if ( !appMPlayer.subWindow.isFullScreen )
{
wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
wsMoveWindow( &appMPlayer.subWindow,True,appMPlayer.sub.x,appMPlayer.sub.y );
}
- guiGetEvent( guiCEvent,guiSetStop );
mplSubRender=1;
wsSetBackgroundRGB( &appMPlayer.subWindow,appMPlayer.subR,appMPlayer.subG,appMPlayer.subB );
wsClearWindow( appMPlayer.subWindow );
@@ -93,16 +94,10 @@ void mplPlay( void )
void mplPause( void )
{
- switch( guiIntfStruct.Playing )
- {
- case 1: // playing
- guiIntfStruct.Playing=2;
- break;
- case 2: // paused
- guiIntfStruct.Playing=1;
- break;
- }
- mplState();
+ mp_cmd_t * cmd = (mp_cmd_t *)calloc( 1,sizeof( *cmd ) );
+ cmd->id=MP_CMD_PAUSE;
+ cmd->name=strdup("pause");
+ mp_input_queue_cmd(cmd);
mplSubRender=0;
}
diff --git a/Gui/skin/skin.c b/Gui/skin/skin.c
index a80d69519b..9b17d23065 100644
--- a/Gui/skin/skin.c
+++ b/Gui/skin/skin.c
@@ -648,7 +648,6 @@ void btnModify( int event,float state )
for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
if ( appMPlayer.Items[j].msg == event )
{
- if ( appMPlayer.Items[j].used ) continue;
switch ( appMPlayer.Items[j].type )
{
case itButton:
diff --git a/mplayer.c b/mplayer.c
index a384a1d3f1..9b37c115e6 100644
--- a/mplayer.c
+++ b/mplayer.c
@@ -769,17 +769,8 @@ if(!use_stdin && !slave_mode){
#ifdef HAVE_NEW_GUI
if ( use_gui ) {
-#ifdef USE_DVDREAD
- if ( guiIntfStruct.DVDChanged )
- {
- guiIntfStruct.DVDChanged=0;
- guiGetEvent( guiCEvent,(char *)guiSetPlay );
- filename="/dev/dvd";
- goto play_dvd;
- }
-#endif
-
- while(guiIntfStruct.Playing!=1){
+ while ( guiIntfStruct.Playing != 1 )
+ {
#ifdef HAVE_NEW_INPUT
mp_cmd_t* cmd;
#endif
@@ -788,9 +779,16 @@ if(!use_stdin && !slave_mode){
#ifdef HAVE_NEW_INPUT
if ( (cmd = mp_input_get_cmd(0,0)) != NULL) guiGetEvent( guiIEvent,(char *)cmd->id );
#endif
- }
+ }
-play_dvd:
+#ifdef USE_DVDREAD
+ if ( guiIntfStruct.DVDChanged )
+ {
+ guiIntfStruct.DVDChanged=0;
+ guiGetEvent( guiCEvent,(char *)guiSetPlay );
+ filename=DEFAULT_DVD_DEVICE;
+ }
+#endif
#ifdef USE_SUB
if ( guiIntfStruct.SubtitleChanged || !guiIntfStruct.FilenameChanged )
@@ -799,7 +797,11 @@ play_dvd:
guiIntfStruct.SubtitleChanged=0;
}
#endif
- if ( guiIntfStruct.FilenameChanged || !filename )
+ if ( ( guiIntfStruct.FilenameChanged || !filename )
+#ifdef USE_DVDREAD
+ && ( guiIntfStruct.StreamType != STREAMTYPE_DVD )
+#endif
+ )
{
play_tree_t * entry = play_tree_new();
play_tree_add_file( entry,guiIntfStruct.Filename );
@@ -819,7 +821,6 @@ play_dvd:
filename = play_tree_iter_get_file(playtree_iter,1);
}
}
-// filename=playtree->child->files[0];
guiIntfStruct.FilenameChanged=0;
}
}
@@ -1284,25 +1285,11 @@ if(auto_quality>0){
guiIntfStruct.MovieWidth=sh_video->disp_w;
guiIntfStruct.MovieHeight=sh_video->disp_h;
guiIntfStruct.StreamType=stream->type;
- guiSetFilename( guiIntfStruct.Filename,filename );
+ guiGetEvent( guiSetFileName,filename );
if ( sh_audio ) guiIntfStruct.AudioType=sh_audio->channels;
else guiIntfStruct.AudioType=0;
#ifdef USE_DVDREAD
- if ( stream->type == STREAMTYPE_DVD )
- {
- dvd_priv_t * dvdp = stream->priv;
- guiIntfStruct.DVD.titles=dvdp->vmg_file->tt_srpt->nr_of_srpts;
- guiIntfStruct.DVD.chapters=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_ptts;
- guiIntfStruct.DVD.angles=dvdp->vmg_file->tt_srpt->title[dvd_title].nr_of_angles;
- guiIntfStruct.DVD.nr_of_audio_channels=dvdp->nr_of_channels;
- memcpy( guiIntfStruct.DVD.audio_streams,dvdp->audio_streams,sizeof( dvdp->audio_streams ) );
- guiIntfStruct.DVD.nr_of_subtitles=dvdp->nr_of_subtitles;
- memcpy( guiIntfStruct.DVD.subtitles,dvdp->subtitles,sizeof( dvdp->subtitles ) );
- guiIntfStruct.DVD.current_title=dvd_title + 1;
- guiIntfStruct.DVD.current_chapter=dvd_chapter + 1;
- guiIntfStruct.DVD.current_angle=dvd_angle + 1;
- guiIntfStruct.Track=dvd_title + 1;
- }
+ if ( stream->type == STREAMTYPE_DVD ) guiGetEvent( guiSetDVD,(char *)stream->priv );
#endif
}
#endif