[Mplayer-cvslog] CVS: main/Gui/mplayer/gtk fs.c,1.14,1.15 fs.h,1.13,1.14 menu.c,1.12,1.13

Zoltan Ponekker pontscho at mplayerhq.hu
Wed Jul 3 00:31:52 CEST 2002


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

Modified Files:
	fs.c fs.h menu.c 
Log Message:
add -audiofile support for gui

Index: fs.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/fs.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- fs.c	2 Jul 2002 21:10:41 -0000	1.14
+++ fs.c	2 Jul 2002 22:31:50 -0000	1.15
@@ -35,7 +35,6 @@
 gchar           fsFilter[64] = "*";
 
 int             fsPressed = 0;
-int             fsMessage = -1;
 int             fsType    = 0;
 
 int gtkVFileSelect = 0;
@@ -64,11 +63,18 @@
            { "SSA (*.ssa)",   						   "*.ssa" },
            { "AQT (*.aqt)",   						   "*.aqt" },
 	   { "Subtitles (*.utf,*.sub,*.srt,*.smi,*.rt,*.txt,*.ssa,*.aqt)", "*.utf,*.sub,*.srt,*.smi,*.rt,*.txt,*.ssa,*.aqt" },
-           { "All files ( * )", "*"     } };
+           { "All files ( * )", 					   "*"     } };
 
 #define fsNumberOfOtherFilterNames 0
 char * fsOtherFilterNames[fsNumberOfOtherFilterNames+1][2] =
          { { "All files ( * )", "*"     } };
+	 
+#define fsNumberOfAudioFilterNames 3
+char * fsAudioFileNames[fsNumberOfAudioFilterNames+1][2] =
+	 { { "WAV files (*.wav)",					   "*.wav" },
+	   { "MP3 files (*.mp2, *.mp3)",				   "*.mp2,*.mp3" },
+	   { "Audio files (*.wav,*.mp2,*.mp3)",				   "*.wav,*.mp2,*.mp3" },
+	   { "All files ( * )",						   "*" } };
 
 GtkWidget   * fsFileNamesList;
 GtkWidget   * fsFNameList;
@@ -207,7 +213,6 @@
  switch ( type )
   {
    case fsVideoSelector:
-        fsMessage=evFileLoaded;
         gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_FileSelect );
         fsList_items=NULL;
         for( i=0;i<fsNumberOfVideoFilterNames + 1;i++ )
@@ -234,6 +239,15 @@
         g_list_free( fsList_items );
         gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsOtherFilterNames[fsNumberOfOtherFilterNames][0] );
         break;
+   case fsAudioSelector:
+	gtk_window_set_title( GTK_WINDOW( fsFileSelect ),MSGTR_AudioFileSelect );
+	fsList_items=NULL;
+	for( i=0;i<fsNumberOfAudioFilterNames + 1;i++ )
+	  fsList_items=g_list_append( fsList_items,fsAudioFileNames[i][0] );
+	gtk_combo_set_popdown_strings( GTK_COMBO( List ),fsList_items );
+	g_list_free( fsList_items );
+	gtk_entry_set_text( GTK_ENTRY( fsFilterCombo ),fsAudioFileNames[fsNumberOfAudioFilterNames - 1][0] );
+	break;
   }
  
  gtk_window_set_modal( GTK_WINDOW( fsFileSelect ),modal );
@@ -269,31 +283,26 @@
    case fsVideoSelector:
           for( i=0;i<fsNumberOfVideoFilterNames+1;i++ )
            if( !strcmp( str,fsVideoFilterNames[i][0] ) )
-            {
-             strcpy( fsFilter,fsVideoFilterNames[i][1] );
-             CheckDir( fsFNameList,get_current_dir_name() );
-             break;
-            }
+            { strcpy( fsFilter,fsVideoFilterNames[i][1] ); break; }
           break;
    case fsSubtitleSelector:
           for( i=0;i<fsNumberOfSubtitleFilterNames+1;i++ )
            if( !strcmp( str,fsSubtitleFilterNames[i][0] ) )
-            {
-             strcpy( fsFilter,fsSubtitleFilterNames[i][1] );
-             CheckDir( fsFNameList,get_current_dir_name() );
-             break;
-            }
+            { strcpy( fsFilter,fsSubtitleFilterNames[i][1] ); break; }
           break;
    case fsOtherSelector:
           for( i=0;i<fsNumberOfOtherFilterNames+1;i++ )
            if( !strcmp( str,fsOtherFilterNames[i][0] ) )
-            {
-             strcpy( fsFilter,fsOtherFilterNames[i][1] );
-             CheckDir( fsFNameList,get_current_dir_name() );
-             break;
-            }
+            { strcpy( fsFilter,fsOtherFilterNames[i][1] ); break; }
           break;
+   case fsAudioSelector:
+          for( i=0;i<fsNumberOfAudioFilterNames+1;i++ )
+           if( !strcmp( str,fsAudioFileNames[i][0] ) )
+            { strcpy( fsFilter,fsAudioFileNames[i][1] ); break; }
+	  break;
+   default: return;
   }
+ CheckDir( fsFNameList,get_current_dir_name() );
 }
 
 void fs_fsPathCombo_activate( GtkEditable * editable,gpointer user_data )
@@ -375,6 +384,8 @@
           guiSetDF( guiIntfStruct.Filename,fsSelectedDirectory,fsSelectedFile );
           guiIntfStruct.StreamType=STREAMTYPE_FILE;
           guiIntfStruct.FilenameChanged=1;
+	  if ( guiIntfStruct.AudioFile ) free( guiIntfStruct.AudioFile );
+	  guiIntfStruct.AudioFile=NULL;
           break;
    case fsSubtitleSelector:
           guiSetDF( guiIntfStruct.Subtitlename,fsSelectedDirectory,fsSelectedFile );
@@ -383,6 +394,9 @@
    case fsOtherSelector:
           guiSetDF( guiIntfStruct.Othername,fsSelectedDirectory,fsSelectedFile );
           break;
+   case fsAudioSelector:
+          guiSetDF( guiIntfStruct.AudioFile,fsSelectedDirectory,fsSelectedFile );
+          break;
   }
 
  HideFileSelect();
@@ -394,7 +408,7 @@
    item=item->next;
   }
  if ( i ) fsTopList_items=g_list_prepend( fsTopList_items,(gchar *)get_current_dir_name() );
- if (  mplMainAutoPlay ) mplEventHandling( evPlay,0 );
+ if ( mplMainAutoPlay ) mplEventHandling( evPlay,0 );
 }
 
 void fs_Cancel_released( GtkButton * button,gpointer user_data )

Index: fs.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/fs.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- fs.h	2 Jul 2002 21:10:41 -0000	1.13
+++ fs.h	2 Jul 2002 22:31:50 -0000	1.14
@@ -6,6 +6,7 @@
 #define fsVideoSelector    0
 #define fsSubtitleSelector 1
 #define fsOtherSelector    2
+#define fsAudioSelector	   3
 
 extern GtkWidget   * fsFileSelect;
 

Index: menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/menu.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- menu.c	6 Jun 2002 07:13:55 -0000	1.12
+++ menu.c	2 Jul 2002 22:31:50 -0000	1.13
@@ -277,6 +277,7 @@
 #endif
     AddMenuItem( SubMenu,MSGTR_MENU_PlayURL, evSetURL );
     AddMenuItem( SubMenu,MSGTR_MENU_LoadSubtitle"   ", evLoadSubtitle );
+    AddMenuItem( SubMenu,MSGTR_MENU_LoadExternAudioFile, evLoadAudioFile );
    SubMenu=AddSubMenu( Menu,MSGTR_MENU_Playing );
     AddMenuItem( SubMenu,MSGTR_MENU_Play"        ", evPlay );
     AddMenuItem( SubMenu,MSGTR_MENU_Pause, evPause );




More information about the MPlayer-cvslog mailing list