[Mplayer-cvslog] CVS: main/Gui/mplayer mplayer.c,1.25,1.26 mw.h,1.61,1.62 play.c,1.65,1.66

Zoltan Ponekker pontscho at mplayerhq.hu
Mon Jun 3 17:06:35 CEST 2002


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

Modified Files:
	mplayer.c mw.h play.c 
Log Message:
add VCD support for GUI

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mplayer.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- mplayer.c	28 May 2002 12:54:57 -0000	1.25
+++ mplayer.c	3 Jun 2002 15:06:32 -0000	1.26
@@ -71,8 +71,9 @@
 
  vo_setwindow( appMPlayer.subWindow.WindowID, appMPlayer.subWindow.wGC );
 
- i=wsHideFrame|wsMaxSize|wsHideWindow;
- if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
+// i=wsHideFrame|wsMaxSize|wsHideWindow;
+// if ( appMPlayer.mainDecoration ) i=wsShowFrame|wsMaxSize|wsHideWindow;
+ i=wsShowFrame|wsMaxSize|wsHideWindow;
  wsCreateWindow( &appMPlayer.mainWindow,
   appMPlayer.main.x,appMPlayer.main.y,appMPlayer.main.width,appMPlayer.main.height,
   wsNoBorder,wsShowMouseCursor|wsHandleMouseButton|wsHandleMouseMove,i,"MPlayer" ); //wsMinSize|
@@ -114,6 +115,8 @@
 
  guiIntfStruct.Playing=0;
 
+ if ( !appMPlayer.mainDecoration ) wsWindowDecoration( &appMPlayer.mainWindow,0 );
+ 
  wsVisibleWindow( &appMPlayer.mainWindow,wsShowWindow );
  wsVisibleWindow( &appMPlayer.subWindow,wsShowWindow );
 }

Index: mw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.h,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -r1.61 -r1.62
--- mw.h	28 May 2002 11:55:16 -0000	1.61
+++ mw.h	3 Jun 2002 15:06:32 -0000	1.62
@@ -35,6 +35,11 @@
             else strcat( tmp,"no chapter" );
           break;
 #endif
+#ifdef HAVE_VCD
+   case STREAMTYPE_VCD:
+        sprintf( tmp,"VCD track %d",guiIntfStruct.Track );
+	break;
+#endif
    default: strcpy( tmp,"no media opened" );
   }
  if ( c )
@@ -102,7 +107,9 @@
            switch ( guiIntfStruct.StreamType )
             {
              case STREAMTYPE_FILE:   strcat( trbuf,"f" ); break;
+#ifdef HAVE_VCD
              case STREAMTYPE_VCD:    strcat( trbuf,"v" ); break;
+#endif
              case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
 #ifdef USE_DVDREAD
              case STREAMTYPE_DVD:    strcat( trbuf,"d" ); break;
@@ -200,6 +207,8 @@
 extern int audio_id;
 extern int dvdsub_id;
 extern char * dvd_device;
+extern int vcd_track;
+extern char * cdrom_device;
 
 void mplEventHandling( int msg,float param )
 {
@@ -212,6 +221,13 @@
         exit_player( "Exit" );
         break;
 
+#ifdef HAVE_VCD
+   case evSetVCDTrack:
+        guiIntfStruct.Track=(int)param;
+   case evPlayVCD:
+	guiIntfStruct.StreamType=STREAMTYPE_VCD;
+	goto play;
+#endif
 #ifdef USE_DVDREAD
    case evPlayDVD:
         guiIntfStruct.DVD.current_title=1;
@@ -222,18 +238,41 @@
 #endif
    case evPlay:
    case evPlaySwitchToPause:
+play:
         mplMainAutoPlay=0;
         if ( ( msg == evPlaySwitchToPause )&&( guiIntfStruct.Playing == 1 ) ) goto NoPause;
 
+	vcd_track=0;
+	dvd_title=0;
+
         switch ( guiIntfStruct.StreamType )
          {
-          case STREAMTYPE_STREAM:
+	  case STREAMTYPE_FILE:
+	       guiGetEvent( guiClearStruct,guiALL );
+	       break;
+#ifdef HAVE_VCD
           case STREAMTYPE_VCD:
-          case STREAMTYPE_FILE:
-               dvd_title=0;
-               break;
+	       guiGetEvent( guiClearStruct,guiALL - guiVCD );
+	       if ( !cdrom_device )
+	        {
+		 cdrom_device=DEFAULT_CDROM_DEVICE;
+		 guiSetFilename( guiIntfStruct.Filename,cdrom_device );
+		}
+	       if ( guiIntfStruct.Playing != 2 )
+	        {
+		 if ( !guiIntfStruct.Track )
+		  {
+		   if ( guiIntfStruct.VCDTracks == 1 ) guiIntfStruct.Track=1;
+		    else guiIntfStruct.Track=2;
+		  }
+		 vcd_track=guiIntfStruct.Track;
+                 guiIntfStruct.DiskChanged=1;
+		}
+	       break;
+#endif
 #ifdef USE_DVDREAD
           case STREAMTYPE_DVD:
+	       guiGetEvent( guiClearStruct,guiALL - guiDVD );
 	       if ( !dvd_device ) 
 	        {
 	         dvd_device=DEFAULT_DVD_DEVICE;
@@ -244,7 +283,7 @@
 	         dvd_title=guiIntfStruct.DVD.current_title;
 	         dvd_angle=guiIntfStruct.DVD.current_angle;
                  dvd_chapter=guiIntfStruct.DVD.current_chapter;
-                 guiIntfStruct.DVDChanged=1;
+                 guiIntfStruct.DiskChanged=1;
 		} 
                break;
 #endif
@@ -287,6 +326,7 @@
 
    case evLoadPlay:
         mplMainAutoPlay=1;
+//	guiIntfStruct.StreamType=STREAMTYPE_FILE;
    case evLoad:
         mplMainRender=1;
         gtkShow( evLoad,NULL );

Index: play.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- play.c	28 May 2002 14:12:32 -0000	1.65
+++ play.c	3 Jun 2002 15:06:32 -0000	1.66
@@ -230,31 +230,38 @@
 void mplPrev( void )
 {
  int stop = 0;
+ 
+ if ( guiIntfStruct.Playing == 2 ) return;
  switch ( guiIntfStruct.StreamType )
   {
-//   case STREAMTYPE_FILE:
 #ifdef USE_DVDREAD
    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;
 #endif
+#ifdef HAVE_VCD
+   case STREAMTYPE_VCD:
+	if ( --guiIntfStruct.Track == 0 ) { guiIntfStruct.Track=1; stop=1; }
+	break;
+#endif
+   default: return;
   }
+ if ( stop ) mplEventHandling( evStop,0 );
+ if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
 }
 
 void mplNext( void )
 {
  int stop = 0;
+
+ if ( guiIntfStruct.Playing == 2 ) return;
  switch ( guiIntfStruct.StreamType )
   {
-//   case STREAMTYPE_FILE:
 #ifdef USE_DVDREAD
    case STREAMTYPE_DVD:
 	if ( guiIntfStruct.DVD.current_chapter++ == guiIntfStruct.DVD.chapters )
@@ -263,9 +270,15 @@
 	  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;
 #endif
+#ifdef HAVE_VCD
+   case STREAMTYPE_VCD:
+	if ( ++guiIntfStruct.Track > guiIntfStruct.VCDTracks ) { guiIntfStruct.Track=guiIntfStruct.VCDTracks; stop=1; }
+	break;
+#endif
+   default: return;
   }
+ if ( stop ) mplEventHandling( evStop,0 );
+ if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evPlay,0 );
 }




More information about the MPlayer-cvslog mailing list