diff options
author | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-02-12 16:05:11 +0000 |
---|---|---|
committer | reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2005-02-12 16:05:11 +0000 |
commit | f630d42c8a91f08923dc09d63cfa0df5d35b253f (patch) | |
tree | 05cd6a4a6b717ecac5b06bc7caad8aee18b0aaaf /Gui/mplayer/gtk | |
parent | 9a2b32ca829838a53fc89aeb4ee5ae7731e5df59 (diff) |
ESD configuration dialog and software volume control option for Gui
Patch by Paul Wilhelm Elsinghorst ( paul [at] uni-bonn de )
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@14687 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/mplayer/gtk')
-rw-r--r-- | Gui/mplayer/gtk/opts.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c index 8be4f61258..f5d787c092 100644 --- a/Gui/mplayer/gtk/opts.c +++ b/Gui/mplayer/gtk/opts.c @@ -52,6 +52,7 @@ static GtkWidget * CBAudioEqualizer; //static GtkWidget * CBSurround; static GtkWidget * CBExtraStereo; static GtkWidget * CBNormalize; +static GtkWidget * CBSoftwareMixer; static GtkWidget * CBDoubleBuffer; static GtkWidget * CBDR; static GtkWidget * CBFramedrop; @@ -180,6 +181,7 @@ void ShowPreferences( void ) #endif gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBExtraStereo ),gtkAOExtraStereo ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBNormalize ),gtkAONorm ); + gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSoftwareMixer ),soft_vol ); gtk_adjustment_set_value( HSExtraStereoMuladj,gtkAOExtraStereoMul ); { int i = 0; @@ -207,6 +209,7 @@ void ShowPreferences( void ) gtk_widget_set_sensitive( AConfig,FALSE ); if ( !strncmp( ao_driver[0],"oss",3 ) || !strncmp( ao_driver[0],"alsa",4 ) || + !strncmp( ao_driver[0],"esd",3 ) || !strncmp( ao_driver[0],"sdl",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE ); } @@ -407,6 +410,7 @@ void ShowPreferences( void ) // -- signals gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)0 ); gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); + gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)1 ); gtk_signal_connect( GTK_OBJECT( CBAudioEqualizer ),"toggled",GTK_SIGNAL_FUNC( prToggled ),(void*)2 ); gtk_signal_connect( GTK_OBJECT( CBShowVideoWindow ),"toggled",GTK_SIGNAL_FUNC( prToggled ), (void*)3 ); #ifdef HAVE_FREETYPE @@ -509,6 +513,7 @@ void prButton( GtkButton * button,gpointer user_data ) gtkEnableAudioEqualizer=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAudioEqualizer ) ); gtkAOExtraStereo=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBExtraStereo ) ); gtkAONorm=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNormalize ) ); + soft_vol=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSoftwareMixer ) ); gtkSet( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL ); audio_delay=HSAudioDelayadj->value; @@ -605,6 +610,7 @@ void prButton( GtkButton * button,gpointer user_data ) gtk_widget_set_sensitive( AConfig,FALSE ); if ( !strncmp( ao_driver[0],"oss",3 ) || !strncmp( ao_driver[0],"alsa",4 ) || + !strncmp( ao_driver[0],"esd",3 ) || !strncmp( ao_driver[0],"sdl",3 ) ) { ShowAudioConfig(); gtk_widget_set_sensitive( AConfig,TRUE ); @@ -727,6 +733,7 @@ static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,g gtk_widget_set_sensitive( AConfig,FALSE ); if ( !strncmp( ao_driver[0],"oss",3 ) || !strncmp( ao_driver[0],"alsa",4 ) || + !strncmp( ao_driver[0],"esd",3 ) || !strncmp( ao_driver[0],"sdl",3 ) ) gtk_widget_set_sensitive( AConfig,TRUE ); break; @@ -836,6 +843,7 @@ GtkWidget * create_Preferences( void ) CBNormalize=AddCheckButton( MSGTR_PREFERENCES_NormalizeSound,vbox3 ); CBAudioEqualizer=AddCheckButton( MSGTR_PREFERENCES_EnEqualizer,vbox3 ); + CBSoftwareMixer=AddCheckButton( MSGTR_PREFERENCES_SoftwareMixer,vbox3 ); #if 0 CBSurround=AddCheckButton( "Enable surround",vbox3 ); #endif @@ -1253,6 +1261,7 @@ GtkWidget * create_Preferences( void ) #if 0 gtk_signal_connect( GTK_OBJECT( CBNormalize ),"toggled",GTK_SIGNAL_FUNC( on_CBNormalize_toggled ),NULL ); + gtk_signal_connect( GTK_OBJECT( CBSoftwareMixer ),"toggled",GTK_SIGNAL_FUNC( on_CBSoftwareMixer_toggled ),NULL ); gtk_signal_connect( GTK_OBJECT( CBSurround ),"toggled",GTK_SIGNAL_FUNC( on_CBSurround_toggled ),NULL ); gtk_signal_connect( GTK_OBJECT( CBExtraStereo ),"toggled",GTK_SIGNAL_FUNC( on_CBExtraStereo_toggled ),NULL ); gtk_signal_connect( GTK_OBJECT( CBDoubleBuffer ),"toggled",GTK_SIGNAL_FUNC( on_CBDoubleBuffer_toggled ),NULL ); @@ -1382,6 +1391,14 @@ GList *appendSDLDevices(GList *l) { } #endif +#ifdef USE_ESD +GList *appendESDDevices(GList *l) { + l = g_list_append(l, (gpointer)"Enter Remote IP"); + l = g_list_append(l, (gpointer)"Use Software Mixer"); + return l; +} +#endif + // Gets text string from a gtk entry, interpreting // MSGTR_PREFERENCES_DriverDefault as null string. char *getGtkEntryText(GtkWidget *from) { @@ -1434,6 +1451,11 @@ void ShowAudioConfig() { setGtkEntryText(CEAudioDevice, gtkAOSDLDriver); } #endif +#ifdef USE_ESD + if (strncmp(ao_driver[0], "esd", 3) == 0) { + setGtkEntryText(CEAudioDevice, gtkAOESDDevice); + } +#endif gtk_widget_show(AudioConfig); gtkSetLayer(AudioConfig); @@ -1475,6 +1497,12 @@ static void audioButton(GtkButton *button, gpointer user_data) { gtkAOSDLDriver = gstrdup(getGtkEntryText(CEAudioDevice)); } #endif +#ifdef USE_ESD + if (strncmp(ao_driver[0], "esd", 3) == 0) { + gfree(>kAOESDDevice); + gtkAOESDDevice = gstrdup(getGtkEntryText(CEAudioDevice)); + } +#endif case 0: HideAudioConfig(); break; @@ -1525,6 +1553,10 @@ GtkWidget *create_AudioConfig() { if (strncmp(ao_driver[0], "sdl", 3) == 0) items = appendSDLDevices(items); #endif +#ifdef USE_ESD + if (strncmp(ao_driver[0], "esd", 3) == 0) + items = appendESDDevices(items); +#endif gtk_combo_set_popdown_strings(GTK_COMBO(CBAudioDevice), items); g_list_free(items); items = NULL; |