[MPlayer-cvslog] r38604 - in trunk/gui/dialog: equalizer.c preferences.c

ib subversion at mplayerhq.hu
Mon Jun 24 21:04:33 EEST 2024


Author: ib
Date: Mon Jun 24 21:04:33 2024
New Revision: 38604

Log:
Replace all motion-notify-event signals with value-changed.

Otherwise, events will be generated for EVERY mouse pointer
movement over the object, even if the slider was not touched
at all.

Modified:
   trunk/gui/dialog/equalizer.c
   trunk/gui/dialog/preferences.c

Modified: trunk/gui/dialog/equalizer.c
==============================================================================
--- trunk/gui/dialog/equalizer.c	Mon Jun 24 21:02:08 2024	(r38603)
+++ trunk/gui/dialog/equalizer.c	Mon Jun 24 21:04:33 2024	(r38604)
@@ -127,12 +127,11 @@ static void eqSetChannelNames( void )
  gtk_clist_select_row( GTK_CLIST( ChannelsList ),0,0 );
 }
 
-static gboolean eqHScaleMotion( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data )
+static void eqHScaleChanged (GtkRange *range, gpointer user_data)
 {
  equalizer_t eq;
 
- (void) widget;
- (void) event;
+ (void) range;
 
  switch ( GPOINTER_TO_INT(user_data) )
   {
@@ -146,7 +145,7 @@ static gboolean eqHScaleMotion( GtkWidge
    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;
+   default: return;
   }
  eq.gain=-eq.gain;
  eq.band=GPOINTER_TO_INT(user_data);
@@ -156,14 +155,11 @@ static gboolean eqHScaleMotion( GtkWidge
    for ( i=0;i<6;i++ )
     { eq.channel=i; mplayer( MPLAYER_SET_EQUALIZER,0,&eq ); }
   } else { eq.channel=Channel; mplayer( MPLAYER_SET_EQUALIZER,0,&eq ); }
-
- return FALSE;
 }
 
-static gboolean eqVScaleMotion( GtkWidget * widget,GdkEventMotion  * event,gpointer user_data )
+static void eqVScaleChanged (GtkRange *range, gpointer user_data)
 {
- (void) widget;
- (void) event;
+ (void) range;
 
  switch( GPOINTER_TO_INT(user_data) )
   {
@@ -172,8 +168,6 @@ static gboolean eqVScaleMotion( GtkWidge
    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;
 }
 
 static void eqButtonReleased( GtkButton * button,gpointer user_data )
@@ -450,21 +444,21 @@ static GtkWidget * CreateEqualizer( void
 
   g_signal_connect( G_OBJECT( ChannelsList ),"select-row",G_CALLBACK( eqSelectChannelsListRow ),NULL );
 
-  g_signal_connect( G_OBJECT( A3125 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(0) );
-  g_signal_connect( G_OBJECT( A6250 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(1) );
-  g_signal_connect( G_OBJECT( A125 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(2) );
-  g_signal_connect( G_OBJECT( A250 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(3) );
-  g_signal_connect( G_OBJECT( A500 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(4) );
-  g_signal_connect( G_OBJECT( A1000 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(5) );
-  g_signal_connect( G_OBJECT( A2000 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(6) );
-  g_signal_connect( G_OBJECT( A4000 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(7) );
-  g_signal_connect( G_OBJECT( A8000 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(8) );
-  g_signal_connect( G_OBJECT( A16000 ),"motion-notify-event",G_CALLBACK( eqHScaleMotion ),GINT_TO_POINTER(9) );
+  g_signal_connect(G_OBJECT(A3125), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(0));
+  g_signal_connect(G_OBJECT(A6250), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(1));
+  g_signal_connect(G_OBJECT(A125), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(2));
+  g_signal_connect(G_OBJECT(A250), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(3));
+  g_signal_connect(G_OBJECT(A500), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(4));
+  g_signal_connect(G_OBJECT(A1000), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(5));
+  g_signal_connect(G_OBJECT(A2000), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(6));
+  g_signal_connect(G_OBJECT(A4000), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(7));
+  g_signal_connect(G_OBJECT(A8000), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(8));
+  g_signal_connect(G_OBJECT(A16000), "value-changed", G_CALLBACK(eqHScaleChanged), GINT_TO_POINTER(9));
 
-  g_signal_connect( G_OBJECT( VContrast ),"motion-notify-event",G_CALLBACK( eqVScaleMotion ),GINT_TO_POINTER(1) );
-  g_signal_connect( G_OBJECT( VBrightness ),"motion-notify-event",G_CALLBACK( eqVScaleMotion ),GINT_TO_POINTER(2) );
-  g_signal_connect( G_OBJECT( VHue ),"motion-notify-event",G_CALLBACK( eqVScaleMotion ),GINT_TO_POINTER(3) );
-  g_signal_connect( G_OBJECT( VSaturation ),"motion-notify-event",G_CALLBACK( eqVScaleMotion ),GINT_TO_POINTER(4) );
+  g_signal_connect(G_OBJECT(VContrast), "value-changed", G_CALLBACK(eqVScaleChanged), GINT_TO_POINTER(1));
+  g_signal_connect(G_OBJECT(VBrightness), "value-changed", G_CALLBACK(eqVScaleChanged), GINT_TO_POINTER(2));
+  g_signal_connect(G_OBJECT(VHue), "value-changed", G_CALLBACK(eqVScaleChanged), GINT_TO_POINTER(3));
+  g_signal_connect(G_OBJECT(VSaturation), "value-changed", G_CALLBACK(eqVScaleChanged), GINT_TO_POINTER(4));
 
   g_signal_connect( G_OBJECT( Ok ),"clicked",G_CALLBACK( eqButtonReleased ),GINT_TO_POINTER(0) );
   g_signal_connect( G_OBJECT( Clear ),"clicked",G_CALLBACK( eqButtonReleased ),GINT_TO_POINTER(1) );

Modified: trunk/gui/dialog/preferences.c
==============================================================================
--- trunk/gui/dialog/preferences.c	Mon Jun 24 21:02:08 2024	(r38603)
+++ trunk/gui/dialog/preferences.c	Mon Jun 24 21:04:33 2024	(r38604)
@@ -220,7 +220,6 @@ static GtkWidget *DXR3Config;
  void ShowDXR3Config( void );
  void ShowAudioConfig( void );
 
-static gboolean prHScaler( GtkWidget * widget,GdkEvent * event,gpointer user_data );
 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data );
 static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,gpointer user_data );
 
@@ -464,10 +463,9 @@ static void prButton( GtkButton * button
   }
 }
 
-static gboolean prHScaler( GtkWidget * widget,GdkEvent * event,gpointer user_data )
+static void prHScaleChanged (GtkRange *range, gpointer user_data)
 {
- (void) widget;
- (void) event;
+ (void) range;
 
  switch ( GPOINTER_TO_INT(user_data) )
   {
@@ -509,7 +507,6 @@ static gboolean prHScaler( GtkWidget * w
         mplayer( MPLAYER_SET_AUTO_QUALITY,gtk_adjustment_get_value(HSPPQualityadj),0 );
         break;
   }
- return FALSE;
 }
 
 static void prToggled( GtkToggleButton * togglebutton,gpointer user_data )
@@ -1202,12 +1199,12 @@ static GtkWidget * CreatePreferences( vo
   g_signal_connect( G_OBJECT( RBFontAutoScaleHeight ),"toggled",G_CALLBACK( prToggled ),GINT_TO_POINTER(5) );
   g_signal_connect( G_OBJECT( RBFontAutoScaleWidth ),"toggled",G_CALLBACK( prToggled ),GINT_TO_POINTER(6) );
   g_signal_connect( G_OBJECT( RBFontAutoScaleDiagonal ),"toggled",G_CALLBACK( prToggled ),GINT_TO_POINTER(7) );
-  g_signal_connect( G_OBJECT( HSFontBlur ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(6) );
-  g_signal_connect( G_OBJECT( HSFontOutLine ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(7) );
-  g_signal_connect( G_OBJECT( HSFontTextScale ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(8) );
-  g_signal_connect( G_OBJECT( HSFontOSDScale ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(9) );
+  g_signal_connect(G_OBJECT(HSFontBlur), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(6));
+  g_signal_connect(G_OBJECT(HSFontOutLine), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(7));
+  g_signal_connect(G_OBJECT(HSFontTextScale), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(8));
+  g_signal_connect(G_OBJECT(HSFontOSDScale), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(9));
 #else
-  g_signal_connect( G_OBJECT( HSFontFactor ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(5) );
+  g_signal_connect(G_OBJECT(HSFontFactor), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(5));
 #endif
   g_signal_connect( G_OBJECT( CBCache ),"toggled",G_CALLBACK( prToggled ),GINT_TO_POINTER(8));
   g_signal_connect( G_OBJECT( CBAutoSync ),"toggled",G_CALLBACK( prToggled ),GINT_TO_POINTER(9));
@@ -1216,15 +1213,15 @@ static GtkWidget * CreatePreferences( vo
 #endif
   g_signal_connect(G_OBJECT(CBReplayGain), "toggled", G_CALLBACK(prToggled), GINT_TO_POINTER(11));
 
-  g_signal_connect( G_OBJECT( HSExtraStereoMul ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(0) );
-  g_signal_connect( G_OBJECT( HSAudioDelay ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(1) );
-  g_signal_connect( G_OBJECT( HSPanscan ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(2) );
-  g_signal_connect( G_OBJECT( HSSubDelay ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(3) );
-  g_signal_connect( G_OBJECT( HSSubPosition ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(4) );
+  g_signal_connect(G_OBJECT(HSExtraStereoMul), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(0));
+  g_signal_connect(G_OBJECT(HSAudioDelay), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(1));
+  g_signal_connect(G_OBJECT(HSPanscan), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(2));
+  g_signal_connect(G_OBJECT(HSSubDelay), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(3));
+  g_signal_connect(G_OBJECT(HSSubPosition), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(4));
 #ifdef CONFIG_ICONV
   g_signal_connect( G_OBJECT( CBSubEncoding ),"changed",G_CALLBACK( prEntry ),GINT_TO_POINTER(1) );
 #endif
-  g_signal_connect( G_OBJECT( HSPPQuality ),"motion-notify-event",G_CALLBACK( prHScaler ),GINT_TO_POINTER(10) );
+  g_signal_connect(G_OBJECT(HSPPQuality), "value-changed", G_CALLBACK(prHScaleChanged), GINT_TO_POINTER(10));
 
   g_signal_connect( G_OBJECT( CLADrivers ),"select-row",G_CALLBACK( prCListRow ),GINT_TO_POINTER(0) );
   g_signal_connect( G_OBJECT( CLVDrivers ),"select-row",G_CALLBACK( prCListRow ),GINT_TO_POINTER(1) );


More information about the MPlayer-cvslog mailing list