[MPlayer-cvslog] r38494 - in trunk/gui/dialog: equalizer.c preferences.c
ib
subversion at mplayerhq.hu
Wed May 1 16:00:28 EEST 2024
Author: ib
Date: Wed May 1 16:00:28 2024
New Revision: 38494
Log:
Prefer gtk_adjustment_get_value() to direct property access.
The GUI should preferably use a more recent GTK+ 2 style.
Modified:
trunk/gui/dialog/equalizer.c
trunk/gui/dialog/preferences.c
Modified: trunk/gui/dialog/equalizer.c
==============================================================================
--- trunk/gui/dialog/equalizer.c Wed May 1 15:59:19 2024 (r38493)
+++ trunk/gui/dialog/equalizer.c Wed May 1 16:00:28 2024 (r38494)
@@ -136,16 +136,16 @@ static gboolean eqHScaleMotion( GtkWidge
switch ( GPOINTER_TO_INT(user_data) )
{
- case 0: eq.gain=A3125adj->value; break;
- case 1: eq.gain=A6250adj->value; break;
- case 2: eq.gain=A125adj->value; break;
- case 3: eq.gain=A250adj->value; break;
- case 4: eq.gain=A500adj->value; break;
- case 5: eq.gain=A1000adj->value; break;
- case 6: eq.gain=A2000adj->value; break;
- case 7: eq.gain=A4000adj->value; break;
- case 8: eq.gain=A8000adj->value; break;
- case 9: eq.gain=A16000adj->value; break;
+ case 0: eq.gain=gtk_adjustment_get_value(A3125adj); break;
+ case 1: eq.gain=gtk_adjustment_get_value(A6250adj); break;
+ case 2: eq.gain=gtk_adjustment_get_value(A125adj); break;
+ case 3: eq.gain=gtk_adjustment_get_value(A250adj); break;
+ case 4: eq.gain=gtk_adjustment_get_value(A500adj); break;
+ case 5: eq.gain=gtk_adjustment_get_value(A1000adj); break;
+ case 6: eq.gain=gtk_adjustment_get_value(A2000adj); break;
+ case 7: eq.gain=gtk_adjustment_get_value(A4000adj); break;
+ case 8: eq.gain=gtk_adjustment_get_value(A8000adj); break;
+ case 9: eq.gain=gtk_adjustment_get_value(A16000adj); break;
default: return FALSE;
}
eq.gain=-eq.gain;
@@ -167,10 +167,10 @@ static gboolean eqVScaleMotion( GtkWidge
switch( GPOINTER_TO_INT(user_data) )
{
- case 1: mplayer( MPLAYER_SET_CONTRAST,VContrastadj->value,0 ); break;
- case 2: mplayer( MPLAYER_SET_BRIGHTNESS,VBrightnessadj->value,0 ); break;
- case 3: mplayer( MPLAYER_SET_HUE,VHueadj->value,0 ); break;
- case 4: mplayer( MPLAYER_SET_SATURATION,VSaturationadj->value,0 ); break;
+ case 1: mplayer( MPLAYER_SET_CONTRAST,gtk_adjustment_get_value(VContrastadj),0 ); break;
+ case 2: mplayer( MPLAYER_SET_BRIGHTNESS,gtk_adjustment_get_value(VBrightnessadj),0 ); break;
+ case 3: mplayer( MPLAYER_SET_HUE,gtk_adjustment_get_value(VHueadj),0 ); break;
+ case 4: mplayer( MPLAYER_SET_SATURATION,gtk_adjustment_get_value(VSaturationadj),0 ); break;
}
return FALSE;
Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c Wed May 1 15:59:19 2024 (r38493)
+++ trunk/gui/dialog/preferences.c Wed May 1 16:00:28 2024 (r38494)
@@ -141,7 +141,7 @@ static GtkWidget * HSPPQuality;
static GtkWidget * HSFPS;
static GtkWidget *RGbox;
-static GtkObject *RGadj;
+static GtkAdjustment *RGadj;
static GtkAdjustment * HSExtraStereoMuladj, * HSAudioDelayadj, * HSPanscanadj, * HSSubDelayadj;
static GtkAdjustment * HSSubPositionadj, * HSSubFPSadj, * HSPPQualityadj, * HSFPSadj;
@@ -293,13 +293,13 @@ static void prButton( GtkButton * button
case bOk:
/* 1st page */
gtkReplayGainOn = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBReplayGain));
- gtkReplayGainAdjustment = GTK_ADJUSTMENT(RGadj)->value;
+ gtkReplayGainAdjustment = gtk_adjustment_get_value(RGadj);
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 ) );
- mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,0 );
- audio_delay=HSAudioDelayadj->value;
+ mplayer( MPLAYER_SET_EXTRA_STEREO,gtk_adjustment_get_value(HSExtraStereoMuladj),0 );
+ audio_delay=gtk_adjustment_get_value(HSAudioDelayadj);
listSet( &audio_driver_list,ao_driver[0] );
listSet( &video_driver_list,vo_driver[0] );
@@ -315,7 +315,7 @@ static void prButton( GtkButton * button
flip=-1;
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBFlip ) ) ) flip=1;
- force_fps=HSFPSadj->value;
+ force_fps=gtk_adjustment_get_value(HSFPSadj);
/* 3rd page */
suboverlap_enabled=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBSubOverlap ) );
@@ -330,9 +330,9 @@ static void prButton( GtkButton * button
gtkASS.top_margin=gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( SBASSTopMargin ) );
gtkASS.bottom_margin=gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON( SBASSBottomMargin ) );
#endif
- sub_delay=HSSubDelayadj->value;
- sub_fps=HSSubFPSadj->value;
- sub_pos=(int)HSSubPositionadj->value;
+ sub_delay=gtk_adjustment_get_value(HSSubDelayadj);
+ sub_fps=gtk_adjustment_get_value(HSSubFPSadj);
+ sub_pos=(int)gtk_adjustment_get_value(HSSubPositionadj);
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDNone ) ) ) osd_level=0;
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDIndicator ) ) ) osd_level=1;
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBOSDTandP ) ) ) osd_level=2;
@@ -342,16 +342,16 @@ static void prButton( GtkButton * button
/* 4th page */
setdup( &font_name,gtk_entry_get_text( GTK_ENTRY( prEFontName ) ) );
#ifdef CONFIG_FREETYPE
- mplayer( MPLAYER_SET_FONT_BLUR,HSFontBluradj->value,0 );
- mplayer( MPLAYER_SET_FONT_OUTLINE,HSFontOutLineadj->value,0 );
- mplayer( MPLAYER_SET_FONT_TEXTSCALE,HSFontTextScaleadj->value,0 );
- mplayer( MPLAYER_SET_FONT_OSDSCALE,HSFontOSDScaleadj->value,0 );
+ mplayer( MPLAYER_SET_FONT_BLUR,gtk_adjustment_get_value(HSFontBluradj),0 );
+ mplayer( MPLAYER_SET_FONT_OUTLINE,gtk_adjustment_get_value(HSFontOutLineadj),0 );
+ mplayer( MPLAYER_SET_FONT_TEXTSCALE,gtk_adjustment_get_value(HSFontTextScaleadj),0 );
+ mplayer( MPLAYER_SET_FONT_OSDSCALE,gtk_adjustment_get_value(HSFontOSDScaleadj),0 );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontNoAutoScale ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,0,0 );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleHeight ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,1,0 );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleWidth ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,2,0 );
if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleDiagonal ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,3,0 );
#else
- mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,0 );
+ mplayer( MPLAYER_SET_FONT_FACTOR,gtk_adjustment_get_value(HSFontFactoradj),0 );
#endif
/* -- 5th page */
@@ -385,12 +385,12 @@ static void prButton( GtkButton * button
gui_tv_digital=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBTVDigital ) );
player_idle_mode=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoIdle ) );
allow_playlist_parsing = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(CBPlaylists));
- mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,0 );
+ mplayer( MPLAYER_SET_AUTO_QUALITY,gtk_adjustment_get_value(HSPPQualityadj),0 );
- if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=True; }
+ if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)gtk_adjustment_get_value(SBCacheadj); gtkCacheOn=True; }
else gtkCacheOn=False;
- if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) { gtkAutoSync=(int)SBAutoSyncadj->value; gtkAutoSyncOn=True; }
+ if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBAutoSync ) ) ) { gtkAutoSync=(int)gtk_adjustment_get_value(SBAutoSyncadj); gtkAutoSyncOn=True; }
else gtkAutoSyncOn=False;
setdup( &dvd_device,gtk_entry_get_text( GTK_ENTRY( prEDVDDevice ) ) );
@@ -448,40 +448,40 @@ static gboolean prHScaler( GtkWidget * w
{
case 0: // extra stereo coefficient
if ( !guiInfo.Playing ) break;
- mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,0 );
+ mplayer( MPLAYER_SET_EXTRA_STEREO,gtk_adjustment_get_value(HSExtraStereoMuladj),0 );
break;
case 1: // audio delay
- audio_delay=HSAudioDelayadj->value;
+ audio_delay=gtk_adjustment_get_value(HSAudioDelayadj);
break;
case 2: // panscan
- mplayer( MPLAYER_SET_PANSCAN,HSPanscanadj->value,0 );
+ mplayer( MPLAYER_SET_PANSCAN,gtk_adjustment_get_value(HSPanscanadj),0 );
break;
case 3: // sub delay
- sub_delay=HSSubDelayadj->value;
+ sub_delay=gtk_adjustment_get_value(HSSubDelayadj);
break;
case 4: // sub position
- sub_pos=(int)HSSubPositionadj->value;
+ sub_pos=(int)gtk_adjustment_get_value(HSSubPositionadj);
break;
#ifdef CONFIG_FREETYPE
case 6: // font blur
- mplayer( MPLAYER_SET_FONT_BLUR,HSFontBluradj->value,0 );
+ mplayer( MPLAYER_SET_FONT_BLUR,gtk_adjustment_get_value(HSFontBluradj),0 );
break;
case 7: // font outline
- mplayer( MPLAYER_SET_FONT_OUTLINE,HSFontOutLineadj->value,0 );
+ mplayer( MPLAYER_SET_FONT_OUTLINE,gtk_adjustment_get_value(HSFontOutLineadj),0 );
break;
case 8: // text scale
- mplayer( MPLAYER_SET_FONT_TEXTSCALE,HSFontTextScaleadj->value,0 );
+ mplayer( MPLAYER_SET_FONT_TEXTSCALE,gtk_adjustment_get_value(HSFontTextScaleadj),0 );
break;
case 9: // osd scale
- mplayer( MPLAYER_SET_FONT_OSDSCALE,HSFontOSDScaleadj->value,0 );
+ mplayer( MPLAYER_SET_FONT_OSDSCALE,gtk_adjustment_get_value(HSFontOSDScaleadj),0 );
break;
#else
case 5: // font factor
- mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,0 );
+ mplayer( MPLAYER_SET_FONT_FACTOR,gtk_adjustment_get_value(HSFontFactoradj),0 );
break;
#endif
case 10: // auto quality
- mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,0 );
+ mplayer( MPLAYER_SET_AUTO_QUALITY,gtk_adjustment_get_value(HSPPQualityadj),0 );
break;
}
return FALSE;
@@ -679,8 +679,8 @@ static GtkWidget * CreatePreferences( vo
CBReplayGain = gtkAddCheckButton(_(MSGTR_GUI_ReplayGain), hbox10);
RGbox = gtkAddHBox(hbox10, 1);
gtkAddLabel(_(MSGTR_GUI_ReplayGainAdjustment), RGbox);
- RGadj = gtk_adjustment_new(gtkReplayGainAdjustment, -30, 10, 1, 5, 0);
- RGspin = gtk_spin_button_new(GTK_ADJUSTMENT(RGadj), 1, 0);
+ RGadj = GTK_ADJUSTMENT(gtk_adjustment_new(gtkReplayGainAdjustment, -30, 10, 1, 5, 0));
+ RGspin = gtk_spin_button_new(RGadj, 1, 0);
gtk_spin_button_set_numeric(GTK_SPIN_BUTTON(RGspin), TRUE);
gtk_box_pack_start(GTK_BOX(RGbox), GTK_WIDGET(RGspin), FALSE, FALSE, 0);
gtkAddLabel(_(MSGTR_GUI_dB), RGbox);
@@ -1211,7 +1211,7 @@ void ShowPreferences( void )
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( CBSurround ),gtkAOSurround );
#endif
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(CBReplayGain), gtkReplayGainOn);
- gtk_adjustment_set_value(GTK_ADJUSTMENT(RGadj), gtkReplayGainAdjustment);
+ gtk_adjustment_set_value(RGadj, gtkReplayGainAdjustment);
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 );
More information about the MPlayer-cvslog
mailing list