changeset 5689:2077782d0ca9

add prev/next title feature for gui dvd support
author pontscho
date Thu, 18 Apr 2002 18:24:08 +0000
parents ad7d3044bea4
children 436cf6ef67fd
files Gui/mplayer/mw.h Gui/mplayer/play.c Gui/mplayer/play.h
diffstat 3 files changed, 44 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Gui/mplayer/mw.h	Thu Apr 18 18:01:25 2002 +0000
+++ b/Gui/mplayer/mw.h	Thu Apr 18 18:24:08 2002 +0000
@@ -297,12 +297,12 @@
         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:
--- a/Gui/mplayer/play.c	Thu Apr 18 18:01:25 2002 +0000
+++ b/Gui/mplayer/play.c	Thu Apr 18 18:24:08 2002 +0000
@@ -66,13 +66,13 @@
  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 @@
  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;
+  }
+}
--- a/Gui/mplayer/play.h	Thu Apr 18 18:01:25 2002 +0000
+++ b/Gui/mplayer/play.h	Thu Apr 18 18:24:08 2002 +0000
@@ -13,6 +13,8 @@
 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 );