[MPlayer-cvslog] r38546 - trunk/gui/dialog/equalizer.c
ib
subversion at mplayerhq.hu
Sun Jun 9 14:16:37 EEST 2024
Author: ib
Date: Sun Jun 9 14:16:37 2024
New Revision: 38546
Log:
Use a variable to simplify code by removing conditions.
Moreover, reopening the already open dialog now updates the widgets.
Modified:
trunk/gui/dialog/equalizer.c
Modified: trunk/gui/dialog/equalizer.c
==============================================================================
--- trunk/gui/dialog/equalizer.c Sun Jun 9 14:14:46 2024 (r38545)
+++ trunk/gui/dialog/equalizer.c Sun Jun 9 14:16:37 2024 (r38546)
@@ -479,6 +479,8 @@ static GtkWidget * CreateEqualizer( void
void ShowEqualizer( void )
{
+ gboolean set;
+
if ( Equalizer ) gtkRaise( Equalizer );
else Equalizer=CreateEqualizer();
@@ -491,29 +493,29 @@ void ShowEqualizer( void )
eqSetChannelNames();
- if ( !guiInfo.Playing || !guiInfo.sh_video )
- {
- gtk_widget_set_sensitive( VContrast,FALSE );
- gtk_widget_set_sensitive( VBrightness,FALSE );
- gtk_widget_set_sensitive( VHue,FALSE );
- gtk_widget_set_sensitive( VSaturation,FALSE );
- }
+ set = (guiInfo.Playing && guiInfo.sh_video);
+
+ gtk_widget_set_sensitive(VContrast, set);
+ gtk_widget_set_sensitive(VBrightness, set);
+ gtk_widget_set_sensitive(VHue, set);
+ gtk_widget_set_sensitive(VSaturation, set);
+
Channel=-1;
eqSetBands( 0 );
- if ( !guiInfo.Playing || !gtkEnableAudioEqualizer )
- {
- gtk_widget_set_sensitive( ChannelsList,FALSE );
- gtk_widget_set_sensitive( A3125,FALSE );
- gtk_widget_set_sensitive( A125,FALSE );
- gtk_widget_set_sensitive( A6250,FALSE );
- gtk_widget_set_sensitive( A250,FALSE );
- gtk_widget_set_sensitive( A500,FALSE );
- gtk_widget_set_sensitive( A1000,FALSE );
- gtk_widget_set_sensitive( A2000,FALSE );
- gtk_widget_set_sensitive( A4000,FALSE );
- gtk_widget_set_sensitive( A8000,FALSE );
- gtk_widget_set_sensitive( A16000,FALSE );
- }
+
+ set = (guiInfo.Playing && gtkEnableAudioEqualizer);
+
+ gtk_widget_set_sensitive(ChannelsList, set);
+ gtk_widget_set_sensitive(A3125, set);
+ gtk_widget_set_sensitive(A125, set);
+ gtk_widget_set_sensitive(A6250, set);
+ gtk_widget_set_sensitive(A250, set);
+ gtk_widget_set_sensitive(A500, set);
+ gtk_widget_set_sensitive(A1000, set);
+ gtk_widget_set_sensitive(A2000, set);
+ gtk_widget_set_sensitive(A4000, set);
+ gtk_widget_set_sensitive(A8000, set);
+ gtk_widget_set_sensitive(A16000, set);
gtk_widget_show( Equalizer );
}
More information about the MPlayer-cvslog
mailing list