- p_object = (vlc_object_t *)pl_Hold( p_intf );
-
- char psz_values[102];
- memset( psz_values, 0, 102 );
-
- /* Write the new bands values */
- /* TODO: write a generic code instead of ten times the same thing */
-
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band1 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band2 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band3 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band4 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band5 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band6 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band7 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band8 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band9 floatValue] );
- sprintf( psz_values, "%s %.1f", psz_values, [o_slider_band10 floatValue] );
-
+ p_object = vlc_object_hold(pl_Get( p_intf ));
+
+ const char *psz_values;
+ 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];