diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-17 21:12:12 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-04-17 21:12:12 +0000 |
commit | a195f967f1665fc96af726095e41c5d973d31eb7 (patch) | |
tree | b0e5f5c57346b199a9dc85723a313d7e8653cbe3 /Gui/mplayer | |
parent | 76ad9ef86e6243c70a8359e0341dea372801a48d (diff) |
fix dvd playing under gui
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5666 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/mplayer')
-rw-r--r-- | Gui/mplayer/mw.h | 39 | ||||
-rw-r--r-- | Gui/mplayer/play.c | 17 |
2 files changed, 21 insertions, 35 deletions
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; } |