[MPlayer-cvslog] r33854 - in trunk/gui: interface.c interface.h ui/gtk/equalizer.c ui/gtk/preferences.c

ib subversion at mplayerhq.hu
Fri Jul 8 23:41:34 CEST 2011


Author: ib
Date: Fri Jul  8 23:41:34 2011
New Revision: 33854

Log:
Rename the mplayer() symbolic constants.

Use prefix MPLAYER for these constants, rename them and use upper case
characters.

Additionally, don't unnecessarily 'float' parameter fparam in mplayer()
calls.

Modified:
   trunk/gui/interface.c
   trunk/gui/interface.h
   trunk/gui/ui/gtk/equalizer.c
   trunk/gui/ui/gtk/preferences.c

Modified: trunk/gui/interface.c
==============================================================================
--- trunk/gui/interface.c	Fri Jul  8 23:11:51 2011	(r33853)
+++ trunk/gui/interface.c	Fri Jul  8 23:41:34 2011	(r33854)
@@ -729,7 +729,7 @@ int gui(int what, void *arg)
                     eq.channel = i;
                     eq.band    = j;
                     eq.gain    = gtkEquChannels[i][j];
-                    mplayer(gtkSetEqualizer, 0, &eq);
+                    mplayer(MPLAYER_SET_EQUALIZER, 0, &eq);
                 }
             }
         }
@@ -941,45 +941,45 @@ void mplayer(int what, float fparam, voi
         // subtitle
 
 #ifndef CONFIG_FREETYPE
-    case gtkSetFontFactor:
+    case MPLAYER_SET_FONT_FACTOR:
         font_factor = fparam;
         mplayerLoadFont();
         break;
 #else
-    case gtkSetFontOutLine:
+    case MPLAYER_SET_FONT_OUTLINE:
         subtitle_font_thickness = (8.0f / 100.0f) * fparam;
         mplayerLoadFont();
         break;
 
-    case gtkSetFontBlur:
+    case MPLAYER_SET_FONT_BLUR:
         subtitle_font_radius = (8.0f / 100.0f) * fparam;
         mplayerLoadFont();
         break;
 
-    case gtkSetFontTextScale:
+    case MPLAYER_SET_FONT_TEXTSCALE:
         text_font_scale_factor = fparam;
         mplayerLoadFont();
         break;
 
-    case gtkSetFontOSDScale:
+    case MPLAYER_SET_FONT_OSDSCALE:
         osd_font_scale_factor = fparam;
         mplayerLoadFont();
         break;
 
-    case gtkSetFontEncoding:
+    case MPLAYER_SET_FONT_ENCODING:
         nfree(subtitle_font_encoding);
         subtitle_font_encoding = gstrdup((char *)vparam);
         mplayerLoadFont();
         break;
 
-    case gtkSetFontAutoScale:
+    case MPLAYER_SET_FONT_AUTOSCALE:
         subtitle_autoscale = (int)fparam;
         mplayerLoadFont();
         break;
 #endif
 
 #ifdef CONFIG_ICONV
-    case gtkSetSubEncoding:
+    case MPLAYER_SET_SUB_ENCODING:
         nfree(sub_cp);
         sub_cp = gstrdup((char *)vparam);
         break;
@@ -1008,13 +1008,13 @@ void mplayer(int what, float fparam, voi
 
         break;
 
-    case gtkSetExtraStereo:
+    case MPLAYER_SET_EXTRA_STEREO:
         gtkAOExtraStereoMul = fparam;
         if (guiInfo.afilter)
             af_control_any_rev(guiInfo.afilter, AF_CONTROL_ES_MUL | AF_CONTROL_SET, &gtkAOExtraStereoMul);
         break;
 
-    case gtkSetPanscan:
+    case MPLAYER_SET_PANSCAN:
     {
         mp_cmd_t *mp_cmd;
 
@@ -1027,33 +1027,33 @@ void mplayer(int what, float fparam, voi
     }
     break;
 
-    case gtkSetAutoq:
+    case MPLAYER_SET_AUTO_QUALITY:
         auto_quality = (int)fparam;
         break;
 
     // set equalizers
 
-    case gtkSetContrast:
+    case MPLAYER_SET_CONTRAST:
         if (guiInfo.sh_video)
             set_video_colors(guiInfo.sh_video, "contrast", (int)fparam);
         break;
 
-    case gtkSetBrightness:
+    case MPLAYER_SET_BRIGHTNESS:
         if (guiInfo.sh_video)
             set_video_colors(guiInfo.sh_video, "brightness", (int)fparam);
         break;
 
-    case gtkSetHue:
+    case MPLAYER_SET_HUE:
         if (guiInfo.sh_video)
             set_video_colors(guiInfo.sh_video, "hue", (int)fparam);
         break;
 
-    case gtkSetSaturation:
+    case MPLAYER_SET_SATURATION:
         if (guiInfo.sh_video)
             set_video_colors(guiInfo.sh_video, "saturation", (int)fparam);
         break;
 
-    case gtkSetEqualizer:
+    case MPLAYER_SET_EQUALIZER:
     {
         af_control_ext_t tmp;
 

Modified: trunk/gui/interface.h
==============================================================================
--- trunk/gui/interface.h	Fri Jul  8 23:11:51 2011	(r33853)
+++ trunk/gui/interface.h	Fri Jul  8 23:41:34 2011	(r33854)
@@ -60,24 +60,24 @@ extern int use_gui;             // this 
 #define guiVCD       2
 #define guiFilenames 4
 #define guiALL       0xffffffff
-
-#define gtkSetContrast      0
-#define gtkSetBrightness    1
-#define gtkSetHue           2
-#define gtkSetSaturation    3
-#define gtkSetEqualizer     4
-#define gtkSetExtraStereo   10
-#define gtkSetPanscan       11
-#define gtkSetFontFactor    12
-#define gtkSetAutoq         13
 #define gtkClearStruct      14
-#define gtkSetFontOutLine   16
-#define gtkSetFontBlur      17
-#define gtkSetFontTextScale 18
-#define gtkSetFontOSDScale  19
-#define gtkSetFontEncoding  20
-#define gtkSetFontAutoScale 21
-#define gtkSetSubEncoding   22
+
+#define MPLAYER_SET_CONTRAST       0
+#define MPLAYER_SET_BRIGHTNESS     1
+#define MPLAYER_SET_HUE            2
+#define MPLAYER_SET_SATURATION     3
+#define MPLAYER_SET_EQUALIZER      4
+#define MPLAYER_SET_EXTRA_STEREO   10
+#define MPLAYER_SET_PANSCAN        11
+#define MPLAYER_SET_FONT_FACTOR    12
+#define MPLAYER_SET_AUTO_QUALITY   13
+#define MPLAYER_SET_FONT_OUTLINE   16
+#define MPLAYER_SET_FONT_BLUR      17
+#define MPLAYER_SET_FONT_TEXTSCALE 18
+#define MPLAYER_SET_FONT_OSDSCALE  19
+#define MPLAYER_SET_FONT_ENCODING  20
+#define MPLAYER_SET_FONT_AUTOSCALE 21
+#define MPLAYER_SET_SUB_ENCODING   22
 
 typedef struct {
     int x;

Modified: trunk/gui/ui/gtk/equalizer.c
==============================================================================
--- trunk/gui/ui/gtk/equalizer.c	Fri Jul  8 23:11:51 2011	(r33853)
+++ trunk/gui/ui/gtk/equalizer.c	Fri Jul  8 23:41:34 2011	(r33854)
@@ -201,8 +201,8 @@ static gboolean eqHScaleMotion( GtkWidge
   {
    int i;
    for ( i=0;i<6;i++ )
-    { eq.channel=i; mplayer( gtkSetEqualizer,0,&eq ); }
-  } else { eq.channel=Channel; mplayer( gtkSetEqualizer,0,&eq ); }
+    { eq.channel=i; mplayer( MPLAYER_SET_EQUALIZER,0,&eq ); }
+  } else { eq.channel=Channel; mplayer( MPLAYER_SET_EQUALIZER,0,&eq ); }
 
  return FALSE;
 }
@@ -212,10 +212,10 @@ static gboolean eqVScaleMotion( GtkWidge
 
  switch( (int)user_data )
   {
-   case 1: mplayer( gtkSetContrast,VContrastadj->value,NULL );      break;
-   case 2: mplayer( gtkSetBrightness,VBrightnessadj->value,NULL );  break;
-   case 3: mplayer( gtkSetHue,VHueadj->value,NULL );	           break;
-   case 4: mplayer( gtkSetSaturation,VSaturationadj->value,NULL );  break;
+   case 1: mplayer( MPLAYER_SET_CONTRAST,VContrastadj->value,NULL );      break;
+   case 2: mplayer( MPLAYER_SET_BRIGHTNESS,VBrightnessadj->value,NULL );  break;
+   case 3: mplayer( MPLAYER_SET_HUE,VHueadj->value,NULL );	           break;
+   case 4: mplayer( MPLAYER_SET_SATURATION,VSaturationadj->value,NULL );  break;
   }
 
  return FALSE;
@@ -230,16 +230,16 @@ static void eqButtonReleased( GtkButton 
 	if ( gtk_notebook_get_current_page( GTK_NOTEBOOK( Notebook ) ) == 0 )
 	 {
 	  if ( !guiInfo.Playing || !gtkEnableAudioEqualizer ) break;
-	  mplayer( gtkSetEqualizer,0,NULL );
+	  mplayer( MPLAYER_SET_EQUALIZER,0,NULL );
 	  eqSetBands( Channel );
 	 }
 	 else
 	  {
 	   if ( !guiInfo.Playing ) break;
-	   mplayer( gtkSetContrast,0.0f,NULL );
-	   mplayer( gtkSetBrightness,0.0f,NULL );
-	   mplayer( gtkSetHue,0.0f,NULL );
-	   mplayer( gtkSetSaturation,0.0f,NULL );
+	   mplayer( MPLAYER_SET_CONTRAST,0,NULL );
+	   mplayer( MPLAYER_SET_BRIGHTNESS,0,NULL );
+	   mplayer( MPLAYER_SET_HUE,0,NULL );
+	   mplayer( MPLAYER_SET_SATURATION,0,NULL );
 	   eqSetBands( Channel );
 	  }
 	break;
@@ -261,7 +261,7 @@ static void eqSelectChannelsListRow( Gtk
    unsigned int i,j; equalizer_t eq;
    for ( i=1;i<FF_ARRAY_ELEMS(gtkEquChannels);i++ )
     for ( j=0;j<FF_ARRAY_ELEMS(*gtkEquChannels);j++ )
-     { eq.band=j; eq.channel=i; eq.gain=gtkEquChannels[0][j]; mplayer( gtkSetEqualizer,0,&eq ); }
+     { eq.band=j; eq.channel=i; eq.gain=gtkEquChannels[0][j]; mplayer( MPLAYER_SET_EQUALIZER,0,&eq ); }
   }
 }
 

Modified: trunk/gui/ui/gtk/preferences.c
==============================================================================
--- trunk/gui/ui/gtk/preferences.c	Fri Jul  8 23:11:51 2011	(r33853)
+++ trunk/gui/ui/gtk/preferences.c	Fri Jul  8 23:41:34 2011	(r33854)
@@ -512,7 +512,7 @@ static void prEntry( GtkContainer * cont
         comment=gtk_entry_get_text( GTK_ENTRY( EFontEncoding ) );
         for ( i=0;lEncoding[i].name;i++ )
 	  if ( !gstrcmp( lEncoding[i].comment,comment ) ) break;
-	if ( lEncoding[i].comment ) mplayer( gtkSetFontEncoding,0,lEncoding[i].name );
+	if ( lEncoding[i].comment ) mplayer( MPLAYER_SET_FONT_ENCODING,0,lEncoding[i].name );
 	break;
 #endif
 #ifdef CONFIG_ICONV
@@ -520,8 +520,8 @@ static void prEntry( GtkContainer * cont
         comment=gtk_entry_get_text( GTK_ENTRY( ESubEncoding ) );
         for ( i=0;lEncoding[i].name;i++ )
 	  if ( !gstrcmp( lEncoding[i].comment,comment ) ) break;
-	if ( lEncoding[i].comment ) mplayer( gtkSetSubEncoding,0,lEncoding[i].name );
-	 else mplayer( gtkSetSubEncoding,0,NULL );
+	if ( lEncoding[i].comment ) mplayer( MPLAYER_SET_SUB_ENCODING,0,lEncoding[i].name );
+	 else mplayer( MPLAYER_SET_SUB_ENCODING,0,NULL );
 	break;
 #endif
   }
@@ -545,7 +545,7 @@ 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( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL );
+	mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,NULL );
 	audio_delay=HSAudioDelayadj->value;
 
 	gaddlist( &audio_driver_list,ao_driver[0] );
@@ -588,16 +588,16 @@ static void prButton( GtkButton * button
         // --- 4. page
 	setdup( &font_name,gtk_entry_get_text( GTK_ENTRY( prEFontName ) ) );
 #ifndef CONFIG_FREETYPE
-	mplayer( gtkSetFontFactor,HSFontFactoradj->value,NULL );
+	mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,NULL );
 #else
-	mplayer( gtkSetFontBlur,HSFontBluradj->value,NULL );
-	mplayer( gtkSetFontOutLine,HSFontOutLineadj->value,NULL );
-	mplayer( gtkSetFontTextScale,HSFontTextScaleadj->value,NULL );
-	mplayer( gtkSetFontOSDScale,HSFontOSDScaleadj->value,NULL );
-	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontNoAutoScale ) ) ) mplayer( gtkSetFontAutoScale,0,NULL );
-	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleHeight ) ) ) mplayer( gtkSetFontAutoScale,1,NULL );
-	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleWidth ) ) ) mplayer( gtkSetFontAutoScale,2,NULL );
-	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleDiagonal ) ) ) mplayer( gtkSetFontAutoScale,3,NULL );
+	mplayer( MPLAYER_SET_FONT_BLUR,HSFontBluradj->value,NULL );
+	mplayer( MPLAYER_SET_FONT_OUTLINE,HSFontOutLineadj->value,NULL );
+	mplayer( MPLAYER_SET_FONT_TEXTSCALE,HSFontTextScaleadj->value,NULL );
+	mplayer( MPLAYER_SET_FONT_OSDSCALE,HSFontOSDScaleadj->value,NULL );
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontNoAutoScale ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,0,NULL );
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleHeight ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,1,NULL );
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleWidth ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,2,NULL );
+	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( RBFontAutoScaleDiagonal ) ) ) mplayer( MPLAYER_SET_FONT_AUTOSCALE,3,NULL );
 #endif
 
 	// -- 5. page
@@ -629,7 +629,7 @@ static void prButton( GtkButton * button
 	stop_xscreensaver=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBStopXScreenSaver ) );
 	gtkEnablePlayBar=gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBPlayBar ) );
 	player_idle_mode=!gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBNoIdle ) );
-	mplayer( gtkSetAutoq,HSPPQualityadj->value,NULL );
+	mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,NULL );
 
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) { gtkCacheSize=(int)SBCacheadj->value; gtkCacheOn=1; }
 	 else gtkCacheOn=0;
@@ -678,13 +678,13 @@ static gboolean prHScaler( GtkWidget * w
   {
    case 0: // extra stereo coefficient
 	if ( !guiInfo.Playing ) break;
-	mplayer( gtkSetExtraStereo,HSExtraStereoMuladj->value,NULL );
+	mplayer( MPLAYER_SET_EXTRA_STEREO,HSExtraStereoMuladj->value,NULL );
 	break;
    case 1: // audio delay
 	audio_delay=HSAudioDelayadj->value;
 	break;
    case 2: // panscan
-        mplayer( gtkSetPanscan,HSPanscanadj->value,NULL );
+        mplayer( MPLAYER_SET_PANSCAN,HSPanscanadj->value,NULL );
 	break;
    case 3: // sub delay
         sub_delay=HSSubDelayadj->value;
@@ -694,24 +694,24 @@ static gboolean prHScaler( GtkWidget * w
 	break;
 #ifndef CONFIG_FREETYPE
    case 5: // font factor
-        mplayer( gtkSetFontFactor,HSFontFactoradj->value,NULL );
+        mplayer( MPLAYER_SET_FONT_FACTOR,HSFontFactoradj->value,NULL );
 	break;
 #else
    case 6: // font blur
-	mplayer( gtkSetFontBlur,HSFontBluradj->value,NULL );
+	mplayer( MPLAYER_SET_FONT_BLUR,HSFontBluradj->value,NULL );
         break;
    case 7: // font outline
-        mplayer( gtkSetFontOutLine,HSFontOutLineadj->value,NULL );
+        mplayer( MPLAYER_SET_FONT_OUTLINE,HSFontOutLineadj->value,NULL );
         break;
    case 8: // text scale
-        mplayer( gtkSetFontTextScale,HSFontTextScaleadj->value,NULL );
+        mplayer( MPLAYER_SET_FONT_TEXTSCALE,HSFontTextScaleadj->value,NULL );
 	break;
    case 9: // osd scale
-        mplayer( gtkSetFontOSDScale,HSFontOSDScaleadj->value,NULL );
+        mplayer( MPLAYER_SET_FONT_OSDSCALE,HSFontOSDScaleadj->value,NULL );
 	break;
 #endif
    case 10: // auto quality
-	mplayer( gtkSetAutoq,HSPPQualityadj->value,NULL );
+	mplayer( MPLAYER_SET_AUTO_QUALITY,HSPPQualityadj->value,NULL );
 	break;
   }
  return FALSE;
@@ -749,7 +749,7 @@ static void prToggled( GtkToggleButton *
    case 5:
    case 6:
    case 7:
-	mplayer( gtkSetFontAutoScale,(float)((int)user_data - 4 ),NULL );
+	mplayer( MPLAYER_SET_FONT_AUTOSCALE,(int)user_data - 4,NULL );
 	break;
    case 8:
 	if ( gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON( CBCache ) ) ) gtk_widget_set_sensitive( SBCache,TRUE );


More information about the MPlayer-cvslog mailing list