[MPlayer-cvslog] r38607 - trunk/gui/dialog/preferences.c
ib
subversion at mplayerhq.hu
Mon Jun 24 21:08:35 EEST 2024
Author: ib
Date: Mon Jun 24 21:08:35 2024
New Revision: 38607
Log:
Keep old gtkAOExtraStereoMul value when canceling the preferences dialog.
Check its current value and reset it if necessary when canceling the
dialog.
Also, do not set it when pressing OK, because prHScaleChanged() will
have already done so if it has been changed.
Moreover, set its initial value when creating the dialog.
Modified:
trunk/gui/dialog/preferences.c
Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c Mon Jun 24 21:06:31 2024 (r38606)
+++ trunk/gui/dialog/preferences.c Mon Jun 24 21:08:35 2024 (r38607)
@@ -214,6 +214,8 @@ static char * ao_driver[3];
static char * vo_driver[3];
static int old_video_driver = 0;
+static float old_gtkAOExtraStereoMul;
+
static GtkWidget *AudioConfig;
static GtkWidget *DXR3Config;
@@ -320,7 +322,6 @@ static void prButton( GtkButton * button
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 ) );
- mplayer( MPLAYER_SET_EXTRA_STEREO,gtk_adjustment_get_value(HSExtraStereoMuladj),0 );
audio_delay=gtk_adjustment_get_value(HSAudioDelayadj);
if (ao_driver[0]) listSet(&audio_driver_list, ao_driver[0]);
@@ -425,9 +426,11 @@ static void prButton( GtkButton * button
}
prNotebookPage = gtk_notebook_get_current_page(GTK_NOTEBOOK(notebook1));
- // fall through
+ goto destroy;
case bCancel:
+ if (gtkAOExtraStereoMul != old_gtkAOExtraStereoMul) mplayer(MPLAYER_SET_EXTRA_STEREO, old_gtkAOExtraStereoMul, 0);
+destroy:
gtk_widget_destroy( Preferences );
if ( AudioConfig ) gtk_widget_destroy( AudioConfig );
#ifdef CONFIG_DXR3
@@ -729,7 +732,8 @@ static GtkWidget * CreatePreferences( vo
hbox8=gtkAddHBox( vbox3,1 );
/*label=*/gtkAddLabelColon( _(MSGTR_GUI_Coefficient),hbox8 );
// gtk_misc_set_padding( GTK_MISC( label ),20,0 );
- HSExtraStereoMuladj=GTK_ADJUSTMENT( gtk_adjustment_new( 0,-10,10,0.1,0,0 ) );
+ old_gtkAOExtraStereoMul = gtkAOExtraStereoMul;
+ HSExtraStereoMuladj=GTK_ADJUSTMENT( gtk_adjustment_new( gtkAOExtraStereoMul,-10,10,0.1,0,0 ) );
HSExtraStereoMul=gtkAddHScale( HSExtraStereoMuladj,hbox8,1 );
gtkAddHSeparator( vbox3 );
@@ -1277,9 +1281,9 @@ void ShowPreferences( void )
prToggled(NULL, GINT_TO_POINTER(11)); // 11 is CBReplayGain, sets sensitivity of RGbox
gtk_adjustment_set_value(RGadj, gtkReplayGainAdjustment);
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBExtraStereo ),gtkAOExtraStereo );
+ prToggled(NULL, GINT_TO_POINTER(0)); // 0 is CBExtraStereo, sets sensitivity of HSExtraStereoMul
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, c = 0;
char * tmp[3]; tmp[2]="";
More information about the MPlayer-cvslog
mailing list