[Mplayer-cvslog] CVS: main/Gui/mplayer mw.h,1.54,1.55 play.c,1.53,1.54 play.h,1.21,1.22

Zoltan Ponekker pontscho at mplayerhq.hu
Thu Apr 18 20:24:10 CEST 2002


Update of /cvsroot/mplayer/main/Gui/mplayer
In directory mail:/var/tmp.root/cvs-serv10067/Gui/mplayer

Modified Files:
	mw.h play.c play.h 
Log Message:
add prev/next title feature for gui dvd support

Index: mw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- mw.h	17 Apr 2002 21:38:21 -0000	1.54
+++ mw.h	18 Apr 2002 18:24:08 -0000	1.55
@@ -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:

Index: play.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -r1.53 -r1.54
--- play.c	17 Apr 2002 21:12:11 -0000	1.53
+++ play.c	18 Apr 2002 18:24:08 -0000	1.54
@@ -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 );
@@ -215,4 +215,43 @@
  if ( !fname ) return;
  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;
+  }
 }

Index: play.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- play.h	11 Mar 2002 09:19:14 -0000	1.21
+++ play.h	18 Apr 2002 18:24:08 -0000	1.22
@@ -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 );




More information about the MPlayer-cvslog mailing list