From 8081bf7ded09d718f68f282917424af58bf26ee1 Mon Sep 17 00:00:00 2001 From: pontscho Date: Thu, 18 Apr 2002 18:24:08 +0000 Subject: add prev/next title feature for gui dvd support git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5690 b3059339-0415-0410-9bf9-f77b7e298cf2 --- Gui/mplayer/mw.h | 4 ++-- Gui/mplayer/play.c | 41 ++++++++++++++++++++++++++++++++++++++++- Gui/mplayer/play.h | 2 ++ 3 files changed, 44 insertions(+), 3 deletions(-) (limited to 'Gui') diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h index 0fdc38cff8..26fca17854 100644 --- a/Gui/mplayer/mw.h +++ b/Gui/mplayer/mw.h @@ -297,12 +297,12 @@ NoPause: gtkShow( evLoadSubtitle,NULL ); break; case evPrev: + mplPrev(); mplMainRender=1; - mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[mw.h] previous stream ...\n" ); break; case evNext: + mplNext(); mplMainRender=1; - mp_dbg( MSGT_GPLAYER,MSGL_DBG2,"[mw.h] next stream ...\n" ); break; case evPlayList: diff --git a/Gui/mplayer/play.c b/Gui/mplayer/play.c index 4442e88380..eb0647cb83 100644 --- a/Gui/mplayer/play.c +++ b/Gui/mplayer/play.c @@ -66,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 ); @@ -216,3 +216,42 @@ void mplSetFileName( char * fname ) if ( guiIntfStruct.Filename ) free( guiIntfStruct.Filename ); guiIntfStruct.Filename=strdup( fname ); } + +void mplPrev( void ) +{ + int stop = 0; + switch ( guiIntfStruct.StreamType ) + { +// case STREAMTYPE_FILE: + case STREAMTYPE_DVD: + if ( guiIntfStruct.Playing == 2 ) break; + if ( --guiIntfStruct.DVD.current_chapter == 0 ) + { + guiIntfStruct.DVD.current_chapter=1; + if ( --guiIntfStruct.DVD.current_title <= 0 ) { guiIntfStruct.DVD.current_title=1; stop=1; } + } + guiIntfStruct.Track=guiIntfStruct.DVD.current_title; + if ( stop ) mplEventHandling( evStop,0 ); + if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); + break; + } +} + +void mplNext( void ) +{ + int stop = 0; + switch ( guiIntfStruct.StreamType ) + { +// case STREAMTYPE_FILE: + case STREAMTYPE_DVD: + if ( guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters ) + { + guiIntfStruct.DVD.current_chapter=1; + if ( ++guiIntfStruct.DVD.current_title > guiIntfStruct.DVD.titles ) { guiIntfStruct.DVD.current_title=guiIntfStruct.DVD.titles; stop=1; } + } + guiIntfStruct.Track=guiIntfStruct.DVD.current_title; + if ( stop ) mplEventHandling( evStop,0 ); + if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 ); + break; + } +} diff --git a/Gui/mplayer/play.h b/Gui/mplayer/play.h index 274cf6e2db..c8f805c134 100644 --- a/Gui/mplayer/play.h +++ b/Gui/mplayer/play.h @@ -13,6 +13,8 @@ extern void mplFullScreen( void ); extern void mplPlay( void ); extern void mplPause( void ); extern void mplState( void ); +extern void mplPrev( void ); +extern void mplNext( void ); extern void mplResizeToMovieSize( unsigned int width,unsigned int height ); extern void mplIncAudioBufDelay( void ); -- cgit v1.2.3