[MPlayer-dev-eng] GUI compilation / mixer changes

Alexander Strasser eclipse7 at gmx.net
Sat Jun 26 13:42:57 CEST 2004


Reimar and I made some trivial changes to the
gui code to make it compile again after the
changes to the mixer interface. 

Maybe the extern declarations of the mixer
should be (more) centralized (maybe in mixer.h).

Alex <beastd>
-------------- next part --------------
Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.757
diff -u -u -r1.757 mplayer.c
--- mplayer.c	26 Jun 2004 09:14:20 -0000	1.757
+++ mplayer.c	26 Jun 2004 11:28:58 -0000
@@ -524,7 +524,7 @@
 extern void mp_input_register_options(m_config_t* cfg);
 
 #include "mixer.h"
-static mixer_t mixer;
+mixer_t mixer;
 
 #include "cfg-mplayer.h"
 
Index: Gui/interface.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/interface.c,v
retrieving revision 1.94
diff -u -u -r1.94 interface.c
--- Gui/interface.c	25 Jun 2004 16:49:52 -0000	1.94
+++ Gui/interface.c	26 Jun 2004 11:28:58 -0000
@@ -42,6 +42,8 @@
 #include "../m_config.h"
 #include "../m_option.h"
 
+extern mixer_t mixer; // mixer from mplayer.c
+
 guiInterface_t guiIntfStruct;
 int guiWinID=-1;
 
@@ -622,7 +624,7 @@
         if ( audio_out )
 	{
 	 float l,r;
-	 mixer_getvolume( &l,&r );
+	 mixer_getvolume( &mixer,&l,&r );
 	 guiIntfStruct.Volume=(r>l?r:l);
 	 if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f;
 	   else guiIntfStruct.Balance=50.0f;
@@ -651,7 +653,7 @@
         if ( audio_out )
 	{
 	 float l,r;
-	 mixer_getvolume( &l,&r );
+	 mixer_getvolume( &mixer,&l,&r );
 	 guiIntfStruct.Volume=(r>l?r:l);
 	 if ( r != l ) guiIntfStruct.Balance=( ( r - l ) + 100 ) * 0.5f;
 	   else guiIntfStruct.Balance=50.0f;
Index: Gui/mplayer/common.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/common.c,v
retrieving revision 1.5
diff -u -u -r1.5 common.c
--- Gui/mplayer/common.c	25 Jun 2004 16:49:52 -0000	1.5
+++ Gui/mplayer/common.c	26 Jun 2004 11:28:58 -0000
@@ -30,6 +30,8 @@
 #include "play.h"
 #include "widgets.h"
 
+extern mixer_t mixer; // mixer from mplayer.c
+
 extern unsigned int GetTimerMS( void );
 
 inline void TranslateFilename( int c,char * tmp,size_t tmplen )
@@ -143,7 +145,7 @@
        case 'l': if ( guiIntfStruct.Playing == 1 ) strlcat( trbuf,"p",sizeof( trbuf ) ); break;
        case 'e': if ( guiIntfStruct.Playing == 2 ) strlcat( trbuf,"e",sizeof( trbuf ) ); break;
        case 'a':
-            if ( muted ) { strlcat( trbuf,"n",sizeof( trbuf ) ); break; }
+            if ( mixer.muted ) { strlcat( trbuf,"n",sizeof( trbuf ) ); break; }
             switch ( guiIntfStruct.AudioType )
              {
               case 0: strlcat( trbuf,"n",sizeof( trbuf ) ); break;
Index: Gui/mplayer/mw.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/mw.c,v
retrieving revision 1.110
diff -u -u -r1.110 mw.c
--- Gui/mplayer/mw.c	26 May 2003 08:45:42 -0000	1.110
+++ Gui/mplayer/mw.c	26 Jun 2004 11:28:58 -0000
@@ -30,6 +30,8 @@
 #include "play.h"
 #include "widgets.h"
 
+extern mixer_t mixer; // mixer from mplayer.c
+
 extern unsigned int GetTimerMS( void );
 
 unsigned char * mplDrawBuffer = NULL;
@@ -242,7 +244,7 @@
 
    case evIncVolume:  vo_x11_putkey( wsGrayMul ); break;
    case evDecVolume:  vo_x11_putkey( wsGrayDiv ); break;
-   case evMute:       mixer_mute(); break;
+   case evMute:       mixer_mute( &mixer ); break;
 
    case evSetVolume:
         guiIntfStruct.Volume=param;
@@ -256,7 +258,7 @@
 	 if ( l > guiIntfStruct.Volume ) l=guiIntfStruct.Volume;
 	 if ( r > guiIntfStruct.Volume ) r=guiIntfStruct.Volume;
 //	 printf( "!!! v: %.2f b: %.2f -> %.2f x %.2f\n",guiIntfStruct.Volume,guiIntfStruct.Balance,l,r );
-         mixer_setvolume( l,r );
+         mixer_setvolume( &mixer,l,r );
 	}
 #ifdef USE_OSD
 	if ( osd_level )
Index: Gui/mplayer/gtk/menu.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/menu.c,v
retrieving revision 1.30
diff -u -u -r1.30 menu.c
--- Gui/mplayer/gtk/menu.c	8 Jan 2004 18:29:27 -0000	1.30
+++ Gui/mplayer/gtk/menu.c	26 Jun 2004 11:28:58 -0000
@@ -17,6 +17,8 @@
 #include "../../../libmpdemux/stream.h"
 #include "../../../libmpdemux/demuxer.h"
 
+extern mixer_t mixer; // mixer from mplayer.c
+
 void ActivateMenuItem( int Item )
 {
 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 );
@@ -462,7 +464,7 @@
    }
 
   AddSeparator( Menu );
-  MenuItem=AddMenuCheckItem( Menu,MSGTR_MENU_Mute,muted,evMute );
+  MenuItem=AddMenuCheckItem( Menu,MSGTR_MENU_Mute,mixer.muted,evMute );
   if ( !guiIntfStruct.AudioType ) gtk_widget_set_sensitive( MenuItem,FALSE );
   AddMenuItem( Menu,MSGTR_MENU_PlayList, evPlayList );
   AddMenuItem( Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser );
Index: Gui/mplayer/gtk/opts.c
===================================================================
RCS file: /cvsroot/mplayer/main/Gui/mplayer/gtk/opts.c,v
retrieving revision 1.62
diff -u -u -r1.62 opts.c
--- Gui/mplayer/gtk/opts.c	3 Feb 2004 19:02:45 -0000	1.62
+++ Gui/mplayer/gtk/opts.c	26 Jun 2004 11:29:00 -0000
@@ -171,7 +171,6 @@
 static void prEntry( GtkContainer * container,gpointer user_data );
 #endif
 
-extern int    muted;
 extern int    stop_xscreensaver;
 
 void ShowPreferences( void )


More information about the MPlayer-dev-eng mailing list