[Mplayer-cvslog] CVS: main/Gui/mplayer mw.h,1.34,1.35 play.h,1.13,1.14 psignal.c,1.19,1.20 sw.h,1.21,1.22 widgets.h,1.9,1.10

Zoltan Ponekker pontscho at mplayer.dev.hu
Wed Nov 21 18:43:58 CET 2001


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

Modified Files:
	mw.h play.h psignal.c sw.h widgets.h 
Log Message:
add half dvd support for gui

Index: mw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- mw.h	19 Nov 2001 09:56:22 -0000	1.34
+++ mw.h	21 Nov 2001 17:43:56 -0000	1.35
@@ -15,6 +15,39 @@
 int             sx = 0,sy = 0;
 int             i,pot = 0;
 
+inline void TranslateFilename( int c,char * tmp )
+{
+ int i;
+ switch ( mplShMem->StreamType )
+  {
+   case STREAMTYPE_FILE:
+          if ( gtkShMem->fs.filename[0] )
+           {
+            strcpy( tmp,gtkShMem->fs.filename );
+            if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
+            if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
+           } else strcpy( tmp,"no file loaded" );
+          break;
+#ifdef USE_DVDREAD		     
+   case STREAMTYPE_DVD:
+          if ( mplShMem->DVD.current_chapter ) sprintf( tmp,"chapter %d",mplShMem->DVD.current_chapter );
+            else strcat( tmp,"no chapter" );
+          break;
+#endif
+   default: strcpy( tmp,"no media opened" );
+  }
+ if ( c )
+  {
+   for ( i=0;i < strlen( tmp );i++ )
+    {
+     int t=0;
+     if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; }
+     if ( c == 2 ) { if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=-32; }
+     tmp[i]=(char)( tmp[i] + t );
+    }
+  }
+}
+
 char * Translate( char * str )
 {
  static char   trbuf[512];
@@ -30,49 +63,10 @@
     {
      switch ( str[++i] )
       {
-       case 't':
-            sprintf( tmp,"%02d",mplShMem->Track ); strcat( trbuf,tmp );
-            break;
-       case 'f':
-            if ( strlen( gtkShMem->fs.filename ) )
-             {
-              int i;
-              strcpy( tmp,gtkShMem->fs.filename );
-              for ( i=0;i < strlen( tmp );i++ )
-               {
-                t=0;
-                if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32;
-                tmp[i]=(char)( tmp[i] + t );
-               }
-              if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
-              if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
-             } else strcpy( tmp,"no file loaded" );
-            strcat( trbuf,tmp );
-            break;
-       case 'F':
-            if ( strlen( gtkShMem->fs.filename ) )
-             {
-              int i;
-              strcpy( tmp,gtkShMem->fs.filename );
-              for ( i=0;i < strlen( tmp );i++ )
-               {
-                char t = 0;
-                if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=32;
-                tmp[i]=tmp[i] - t;
-               }
-              if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0;
-              if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0;
-             } else strcpy( tmp,"NO FILE LOADED" );
-            strcat( trbuf,tmp );
-            break;
-       case 'o':
-            if ( strlen( gtkShMem->fs.filename ) )
-             {
-              strcat( trbuf,gtkShMem->fs.filename );
-              if ( trbuf[strlen( trbuf ) - 4] == '.' ) trbuf[strlen( trbuf ) - 4]=0;
-              if ( trbuf[strlen( trbuf ) - 5] == '.' ) trbuf[strlen( trbuf ) - 5]=0;
-             } else strcat( trbuf,"no file loaded" );
-            break;
+       case 't': sprintf( tmp,"%02d",mplShMem->Track ); strcat( trbuf,tmp ); break;
+       case 'o': TranslateFilename( 0,tmp ); strcat( trbuf,tmp ); break;
+       case 'f': TranslateFilename( 1,tmp ); strcat( trbuf,tmp ); break;
+       case 'F': TranslateFilename( 2,tmp ); strcat( trbuf,tmp ); break;
        case '6': t=mplShMem->LengthInSec; goto calclengthhhmmss;
        case '1': t=mplShMem->TimeSec;
 calclengthhhmmss:
@@ -109,7 +103,9 @@
              case STREAMTYPE_FILE:   strcat( trbuf,"f" ); break;
              case STREAMTYPE_VCD:    strcat( trbuf,"v" ); break;
              case STREAMTYPE_STREAM: strcat( trbuf,"u" ); break;
+#ifdef USE_DVDREAD		     
              case STREAMTYPE_DVD:    strcat( trbuf,"d" ); break;
+#endif
              default:                strcat( trbuf," " ); break;
             }
            break;
@@ -122,7 +118,7 @@
  return trbuf;
 }
 
-void PutImage( txSample * bf,int x,int y,int max,int ofs )
+inline void PutImage( txSample * bf,int x,int y,int max,int ofs )
 {
  int i=0,ix,iy;
  unsigned long * buf = NULL;
@@ -157,21 +153,6 @@
  btnModify( evSetMoviePosition,mplShMem->Position );
  btnModify( evSetVolume,mplShMem->Volume );
 
- switch ( mplShMem->Playing )
-  {
-   case 2:
-   case 0:
-        btnModify( evPlaySwitchToPause,btnReleased );
-        btnModify( evPauseSwitchToPlay,btnDisabled );
-        break;
-   case 1:
-        if ( mplShMem->Filename[0] != 0 )
-         {
-          btnModify( evPlaySwitchToPause,btnDisabled );
-          btnModify( evPauseSwitchToPlay,btnReleased );
-         }
-  }
-
  if ( mplMainRender )
   {
    memcpy( mplDrawBuffer,appMPlayer.main.Bitmap.Image,appMPlayer.main.Bitmap.ImageSize );
@@ -229,8 +210,10 @@
         exit_player( "Exit" );
         break;
 
+#ifdef USE_DVDREAD
    case evPlayDVD:
         mplShMem->StreamType=STREAMTYPE_DVD;
+#endif
 	
    case evPlay:
    case evPlaySwitchToPause:
@@ -246,21 +229,20 @@
           case STREAMTYPE_FILE:   
 	       dvd_title=0;
 	       break;
+#ifdef USE_DVDREAD
           case STREAMTYPE_DVD:    
 	       dvd_title=1; 
 	       dvd_chapter=1; 
 	       dvd_angle=1; 
 	       strcpy( mplShMem->Filename,"/dev/dvd" );
 	       break;
+#endif
          }
         mplPlay();
         break;
-	
-//        break;
 
    case evPause:
    case evPauseSwitchToPlay:
-Pause:
         btnModify( evPlaySwitchToPause,btnReleased );
         btnModify( evPauseSwitchToPlay,btnDisabled );
 NoPause:
@@ -397,7 +379,7 @@
 	if ( mplMiddleMenu )
 	 {
 	  mplMiddleMenu=0;
-	  mplMsgHandle( gtkShMem->popupmenu,0 );
+	  mplMsgHandle( gtkShMem->popupmenu,gtkShMem->popupmenuparam );
 	 }
         break;
 // --- system events
@@ -488,6 +470,7 @@
           break;
 	  
    case wsPMMouseButton:
+	memcpy( &gtkShMem->DVD,&mplShMem->DVD,sizeof( mplDVDStruct ) );
         gtkSendMessage( evShowPopUpMenu );
 	break;	  
 

Index: play.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/play.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- play.h	12 Nov 2001 15:16:13 -0000	1.13
+++ play.h	21 Nov 2001 17:43:56 -0000	1.14
@@ -2,9 +2,15 @@
 #ifndef __GUI_PLAY_H
 #define __GUI_PLAY_H
 
+#include "../../config.h"
+
 #include "./psignal.h"
 #include "./mplayer.h"
 
+#ifdef USE_DVDREAD
+ #include "../../libmpdemux/stream.h"
+#endif
+
 typedef struct
 {
  int x;
@@ -28,12 +34,30 @@
  char codecdll[128];
 } mplVideoStruct;
 
+#ifdef USE_DVDREAD
+typedef struct
+{
+ int titles;
+ int chapters;
+ int angles;
+ int current_chapter;
+ int current_title;
+ int nr_of_audio_channels;
+ audio_stream_t audio_streams[8];
+ int nr_of_subtitles;
+ subtitle_t subtitles[32]; 
+} mplDVDStruct;
+#endif
+
 typedef struct
 {
  int message;
    mplResizeStruct      resize;
    mplVideoStruct       videodata;
    mplUnknowErrorStruct error;
+#ifdef USE_DVDREAD
+   mplDVDStruct         DVD;
+#endif
 
    int    Playing;
    float  Position;

Index: psignal.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/psignal.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- psignal.c	18 Nov 2001 19:22:54 -0000	1.19
+++ psignal.c	21 Nov 2001 17:43:56 -0000	1.20
@@ -127,7 +127,7 @@
 	gtk_main_quit();
         break;
    case evShowPopUpMenu:
-        gtkShMem->popupmenu=evNone;
+        gtkShMem->popupmenu=evNone; gtkShMem->popupmenuparam=0;
 	if ( gtkShMem->visiblepopupmenu ) gtk_widget_hide_on_delete( PopUpMenu );
         PopUpMenu=create_PopUpMenu();
         gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
@@ -190,7 +190,7 @@
         if ( mplMainAutoPlay ) mplGeneralTimer=1;
         break;
    case evShowPopUpMenu:
-        fprintf( stderr,"[psignal] PopUpMenu: %d\n",gtkShMem->popupmenu );
+        fprintf( stderr,"[psignal] PopUpMenu: %d param: %d\n",gtkShMem->popupmenu,gtkShMem->popupmenuparam );
 	mplMiddleMenu=1; mplGeneralTimer=1; 
 	break;
    case evMessageBox:

Index: sw.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/sw.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- sw.h	18 Nov 2001 19:22:54 -0000	1.21
+++ sw.h	21 Nov 2001 17:43:56 -0000	1.22
@@ -37,6 +37,7 @@
  switch( Button )
   {
    case wsPMMouseButton:
+	  memcpy( &gtkShMem->DVD,&mplShMem->DVD,sizeof( mplDVDStruct ) );
           gtkSendMessage( evShowPopUpMenu );
           break;
    case wsPRMouseButton:

Index: widgets.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/widgets.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- widgets.h	18 Nov 2001 19:22:54 -0000	1.9
+++ widgets.h	21 Nov 2001 17:43:56 -0000	1.10
@@ -5,7 +5,9 @@
 #include <gdk/gdkkeysyms.h>
 #include <gtk/gtk.h>
 
+#include "../../config.h"
 #include "../../linux/shmem.h"
+#include "play.h"
 
 #define GTK_MB_SIMPLE 0
 #define GTK_MB_MODAL 1
@@ -52,8 +54,13 @@
  gtkSkinStruct         sb;
  gtkVisibleStruct      vs;
  gtkOptionsStruct      op;
+
+#ifdef USE_DVDREAD 
+ mplDVDStruct          DVD;
+#endif
  
  int		       popupmenu;
+ int		       popupmenuparam;
  int		       visiblepopupmenu;
 } gtkCommStruct;
 




More information about the MPlayer-cvslog mailing list