[Mplayer-cvslog] CVS: main/Gui/mplayer mw.h,1.69,1.70 play.c,1.66,1.67 play.h,1.25,1.26 widgets.c,1.31,1.32

Zoltan Ponekker pontscho at mplayerhq.hu
Fri Jul 12 02:53:28 CEST 2002


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

Modified Files:
	mw.h play.c play.h widgets.c 
Log Message:
add simple playlist support

Index: mw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.h,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -r1.69 -r1.70
--- mw.h	5 Jul 2002 23:46:57 -0000	1.69
+++ mw.h	12 Jul 2002 00:53:25 -0000	1.70
@@ -254,12 +254,24 @@
    case evPlay:
    case evPlaySwitchToPause:
 play:
+
         mplMainAutoPlay=0;
         if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
 
 	vcd_track=0;
 	dvd_title=0;
 
+	if ( gtkSet( gtkGetCurrPlItem,0,NULL ) )
+	 {
+	  plItem * next = gtkSet( gtkGetCurrPlItem,0,NULL );
+	  plLastPlayed=next;
+	  guiSetDF( guiIntfStruct.Filename,next->path,next->name );
+	  guiIntfStruct.StreamType=STREAMTYPE_FILE;
+	  guiIntfStruct.FilenameChanged=1;
+	  if ( guiIntfStruct.AudioFile ) free( guiIntfStruct.AudioFile );
+	  guiIntfStruct.AudioFile=NULL;
+	 }
+
         switch ( guiIntfStruct.StreamType )
          {
 	  case STREAMTYPE_STREAM:
@@ -345,6 +357,7 @@
 //	guiIntfStruct.StreamType=STREAMTYPE_FILE;
    case evLoad:
         mplMainRender=1;
+	gtkSet( gtkDelPl,0,NULL );
         gtkShow( evLoad,NULL );
         break;
    case evLoadSubtitle:
@@ -363,15 +376,11 @@
         mplMainRender=1;
         break;
 
-   case evPlayList:
-        mplMainRender=1;
-        gtkShow( evPlayList,NULL );
-        break;
-
+   case evPlayList:    gtkShow( evPlayList,NULL );        break;
    case evSkinBrowser: gtkShow( evSkinBrowser,skinName ); break;
-   case evAbout:       gtkShow( evAbout,NULL ); break;
-   case evPreferences: gtkShow( evPreferences,NULL ); break;
-   case evEqualizer:   gtkShow( evEqualizer,NULL ); break;
+   case evAbout:       gtkShow( evAbout,NULL );           break;
+   case evPreferences: gtkShow( evPreferences,NULL );     break;
+   case evEqualizer:   gtkShow( evEqualizer,NULL );       break;
 
    case evForward1min:      mplRelSeek( 60 );  break;
    case evBackward1min:     mplRelSeek( -60 ); break;

Index: play.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- play.c	3 Jun 2002 15:06:32 -0000	1.66
+++ play.c	12 Jul 2002 00:53:25 -0000	1.67
@@ -27,6 +27,8 @@
 extern float rel_seek_secs;
 extern int abs_seek_pos;
 
+static int mplGotoTheNext = 1;
+
 void mplFullScreen( void )
 {
  static int sx,sy;
@@ -83,13 +85,30 @@
 
 extern int mplSubRender;
 
-void mplStop()
+void mplEnd( void )
+{
+ plItem * next;
+
+ if ( !mplGotoTheNext ) { mplGotoTheNext=1; return; }
+
+ if ( (next=gtkSet( gtkGetNextPlItem,0,NULL )) && plLastPlayed != next )
+  {
+   plLastPlayed=next;
+   guiSetDF( guiIntfStruct.Filename,next->path,next->name );
+   guiIntfStruct.StreamType=STREAMTYPE_FILE;
+   guiIntfStruct.FilenameChanged=1;
+   if ( guiIntfStruct.AudioFile ) free( guiIntfStruct.AudioFile );
+   guiIntfStruct.AudioFile=NULL;
+  } else mplStop();
+}
+
+void mplStop( void )
 {
  guiIntfStruct.Playing=0;
  guiIntfStruct.TimeSec=0;
  guiIntfStruct.Position=0;
  guiIntfStruct.AudioType=0;
-// if ( !guiIntfStruct.Playing ) return;
+
  if ( !appMPlayer.subWindow.isFullScreen )
   {
    wsResizeWindow( &appMPlayer.subWindow,appMPlayer.sub.width,appMPlayer.sub.height );
@@ -229,7 +248,8 @@
 
 void mplPrev( void )
 {
- int stop = 0;
+ plItem * prev;
+ int      stop = 0;
  
  if ( guiIntfStruct.Playing == 2 ) return;
  switch ( guiIntfStruct.StreamType )
@@ -249,7 +269,14 @@
 	if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; }
 	break;
 #endif
-   default: return;
+   default: 
+	if ( (prev=gtkSet( gtkGetPrevPlItem,0,NULL)) ) { mplGotoTheNext=0; break; }
+//	 {
+//	  guiSetDF( guiIntfStruct.Filename,prev->path,prev->name );
+//	  guiIntfStruct.FilenameChanged=1;
+//	  break;
+//	 }
+	return;
   }
  if ( stop ) mplEventHandling( evStop,0 );
  if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
@@ -257,7 +284,8 @@
 
 void mplNext( void )
 {
- int stop = 0;
+ int      stop = 0;
+ plItem * next;
 
  if ( guiIntfStruct.Playing == 2 ) return;
  switch ( guiIntfStruct.StreamType )
@@ -277,7 +305,14 @@
 	if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; }
 	break;
 #endif
-   default: return;
+   default:
+	if ( (next=gtkSet( gtkGetNextPlItem,0,NULL)) ) { mplGotoTheNext=0; break; }
+//	 {
+//	  guiSetDF( guiIntfStruct.Filename,next->path,next->name );
+//	  guiIntfStruct.FilenameChanged=1;
+//	  break;
+//	 }
+	return;
   }
  if ( stop ) mplEventHandling( evStop,0 );
  if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );

Index: play.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- play.h	28 May 2002 12:54:57 -0000	1.25
+++ play.h	12 Jul 2002 00:53:25 -0000	1.26
@@ -6,7 +6,8 @@
 
 #include "./mplayer.h"
 
-extern void mplStop();
+extern void mplEnd( void );
+extern void mplStop( void );
 extern void mplFullScreen( void );
 extern void mplPlay( void );
 extern void mplPause( void );

Index: widgets.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/widgets.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- widgets.c	5 Jul 2002 23:46:57 -0000	1.31
+++ widgets.c	12 Jul 2002 00:53:25 -0000	1.32
@@ -30,7 +30,6 @@
 #include "../../config.h"
 #include "../../help_mp.h"
 
-GtkWidget     * PlayList;
 GtkWidget     * Options;
 GtkWidget     * PopUpMenu = NULL;
 
@@ -192,10 +191,9 @@
 //	gtkSetLayer( Options );
         break;
    case evPlayList:
-        gtkMessageBox( GTK_MB_WARNING,"Sorry, this feature is under development ..." );
-//	PlayList=create_PlayList();
-//        gtk_widget_show( PlayList );
-//	gtkSetLayer( PlayList );
+//	gtkMessageBox( GTK_MB_WARNING,"Sorry, this feature is under development ..." );
+        ShowPlayList();
+	gtkSetLayer( PlayList );
         break;
    case evLoad:
         ShowFileSelect( fsVideoSelector,0 );




More information about the MPlayer-cvslog mailing list