[vlc-devel] commit: macosx intf: Fix bug in equalizer (Derk-Jan Hartman )

git version control git at videolan.org
Sat May 30 00:32:49 CEST 2009


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Fri May 29 13:10:23 2009 +0200| [1e0431230da07cbe0fcba2d225289d59bc8a4251] | committer: Jean-Baptiste Kempf 

macosx intf: Fix bug in equalizer

Introduced by [ca17039cd8dbaff98d0d4f08b94d3f3efa92af98]
(cherry picked from commit c543a40de86224b961a089d0a17374867f835da4)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=1e0431230da07cbe0fcba2d225289d59bc8a4251
---

 modules/gui/macosx/equalizer.m |   25 ++++++++++++-------------
 1 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/modules/gui/macosx/equalizer.m b/modules/gui/macosx/equalizer.m
index 1b6af6b..63b9d23 100644
--- a/modules/gui/macosx/equalizer.m
+++ b/modules/gui/macosx/equalizer.m
@@ -240,18 +240,17 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
     if( p_object == NULL )
         p_object = (vlc_object_t *)pl_Hold( p_intf );
 
-    NSString *preset;
     const char *psz_values;
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band1 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band2 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band3 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band4 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band5 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band6 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band7 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band8 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band9 floatValue] ];
-    preset = [NSString stringWithFormat:@"%@ %.1f", preset, [o_slider_band10 floatValue] ];
+    NSString *preset = [NSString stringWithFormat:@"%.1f", [o_slider_band1 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f ", [o_slider_band2 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f ", [o_slider_band3 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f ", [o_slider_band4 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f ", [o_slider_band5 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f ", [o_slider_band6 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f ", [o_slider_band7 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f ", [o_slider_band8 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f ", [o_slider_band9 floatValue] ];
+    preset = [preset stringByAppendingFormat:@"%.1f", [o_slider_band10 floatValue] ];
 
     psz_values = [preset UTF8String];
     var_SetString( p_object, "equalizer-bands", psz_values );
@@ -279,11 +278,11 @@ static bool GetFiltersStatus( intf_thread_t *p_intf,
 
     var_SetString( p_object , "equalizer-preset" , preset_list[[sender indexOfSelectedItem]] );
 
-    NSString *preset;
+    NSString *preset = @"";
     const char *psz_values;
     for( i = 0; i < 10; i++ )
     {
-        preset = [NSString stringWithFormat:@"%@ %.1f", preset, eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[i] ];
+        preset = [preset stringByAppendingFormat:@"%.1f ", eqz_preset_10b[[sender indexOfSelectedItem]]->f_amp[i] ];
     }
     psz_values = [preset UTF8String];
     var_SetString( p_object, "equalizer-bands", psz_values );




More information about the vlc-devel mailing list