[Mplayer-cvslog] CVS: main/Gui interface.c,1.30,1.31 interface.h,1.17,1.18

Zoltan Ponekker pontscho at mplayerhq.hu
Sun Aug 4 21:23:59 CEST 2002


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

Modified Files:
	interface.c interface.h 
Log Message:


- fix mixer handling
- some change in menu
- fix evLoadPlay bug
- etc


Index: interface.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- interface.c	4 Aug 2002 17:23:58 -0000	1.30
+++ interface.c	4 Aug 2002 19:23:56 -0000	1.31
@@ -286,6 +286,18 @@
 	mplEventHandling( evRedraw,0 );
 	break;
    case guiSetVolume:
+        if ( audio_out )
+	{
+	 float l,r;
+	 mixer_getvolume( &l,&r );
+	 guiIntfStruct.Volume=(r>l?r:l);
+	 if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f;
+	   else guiIntfStruct.Balance=50.0f;
+	 btnModify( evSetVolume,guiIntfStruct.Volume );
+	 btnModify( evSetBalance,guiIntfStruct.Balance );
+	}
+	break;
+   case guiSetValues:
 // -- audio
         if ( audio_out )
 	{
@@ -329,21 +341,31 @@
 	 }
 
        guiIntfStruct.DiskChanged=0;
-//       guiIntfStruct.FilenameChanged=0;
 
 // --- video opts	 
        if ( !gtkVODriver )
 	{
          int i = 0;
-         while ( video_out_drivers[i++] )
-	  if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) 
-	   {
-	    const vo_info_t *info = video_out_drivers[i - 1]->get_info();
-	     { gtkVODriver=gstrdup( (char *)info->short_name ); break; }
-	   }
+	 if ( video_driver && !gtkVODriver )
+	  {
+	   while ( video_out_drivers[i] )
+	    if ( video_out_drivers[i++]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE )
+	     {
+	      const vo_info_t *info = video_out_drivers[i - 1]->get_info();
+	      if ( !gstrcmp( video_driver,(char *)info->short_name ) ) gtkVODriver=gstrdup( video_driver );
+	     }
+	  }
+	  else
+           while ( video_out_drivers[i++] )
+	    if ( video_out_drivers[i - 1]->control( VOCTRL_GUISUPPORT,NULL ) == VO_TRUE ) 
+	     {
+	      const vo_info_t *info = video_out_drivers[i - 1]->get_info();
+	      gtkVODriver=gstrdup( (char *)info->short_name );
+	      break;
+	     }
 	 }
 	
-	if ( gtkVODriver ) { if ( video_driver ) free( video_driver ); video_driver=strdup( gtkVODriver ); }
+	if ( gtkVODriver ) { gfree( (void **)&video_driver ); video_driver=gstrdup( gtkVODriver ); }
 	  else { gtkMessageBox( GTK_MB_FATAL,MSGTR_IDFGCVD ); exit_player( "gui init" ); }
 	
 	if ( gtkVPP )
@@ -393,7 +415,8 @@
 	  ao_plugin_cfg.pl_extrastereo_mul=gtkAOExtraStereoMul;
 	 }
 	mixer_device=gtkAOOSSMixer;
-	if ( audio_driver ) free( audio_driver ); 
+	if ( audio_driver && !gtkAODriver ) gtkAODriver=gstrdup( audio_driver );
+	gfree( (void **)&audio_driver );
 	if ( !gstrcmp( gtkAODriver,"oss" ) && gtkAOOSSDevice )
 	 {
 	  char * tmp = calloc( 1,strlen( gtkAODriver ) + strlen( gtkAOOSSDevice ) + 2 );

Index: interface.h
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- interface.h	25 Jul 2002 20:26:29 -0000	1.17
+++ interface.h	4 Aug 2002 19:23:56 -0000	1.18
@@ -115,6 +115,7 @@
 #define guiReDraw	    10
 #define guiSetVolume        11
 #define guiSetDefaults	    12
+#define guiSetValues	    13
 
 #define guiSetStop  0
 #define guiSetPlay  1




More information about the MPlayer-cvslog mailing list