[vlc-commits] macosx: updated gui for new spatializer values (close #6516)

Felix Paul Kühne git at videolan.org
Sun Apr 1 19:20:00 CEST 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sun Apr  1 19:19:17 2012 +0200| [dc22d971eec913b5a28cd819b6988e64dc8a45c2] | committer: Felix Paul Kühne

macosx: updated gui for new spatializer values (close #6516)
(cherry picked from commit 6b7628d8e4512631ff1cf3a6d00e147ac2ecbfba)

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

 modules/gui/macosx/AudioEffects.m |   45 +++++++++++++++++++------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/modules/gui/macosx/AudioEffects.m b/modules/gui/macosx/AudioEffects.m
index 22ae31e..925f643 100644
--- a/modules/gui/macosx/AudioEffects.m
+++ b/modules/gui/macosx/AudioEffects.m
@@ -528,33 +528,34 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
     else
         [o_spat_enable_ckb setState: NSOffState];
 
-    [o_spat_band1_sld setFloatValue: config_GetFloat( p_intf, "spatializer-roomsize" )];
-    [o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band1_sld floatValue]]];
-    [o_spat_band2_sld setFloatValue: config_GetFloat( p_intf, "spatializer-width" )];
-    [o_spat_band2_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band2_sld floatValue]]];
-    [o_spat_band3_sld setFloatValue: config_GetFloat( p_intf, "spatializer-wet" )];
-    [o_spat_band3_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band3_sld floatValue]]];
-    [o_spat_band4_sld setFloatValue: config_GetFloat( p_intf, "spatializer-dry" )];
-    [o_spat_band4_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band4_sld floatValue]]];
-    [o_spat_band5_sld setFloatValue: config_GetFloat( p_intf, "spatializer-damp" )];
-    [o_spat_band5_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band5_sld floatValue]]];
+#define setSlider( bandsld, bandfld, var ) \
+    [bandsld setFloatValue: config_GetFloat( p_intf, var ) * 10.]; \
+    [bandfld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [bandsld floatValue]]]
+
+    setSlider( o_spat_band1_sld, o_spat_band1_fld, "spatializer-roomsize" );
+    setSlider( o_spat_band2_sld, o_spat_band2_fld, "spatializer-width" );
+    setSlider( o_spat_band3_sld, o_spat_band3_fld, "spatializer-wet" );
+    setSlider( o_spat_band4_sld, o_spat_band4_fld, "spatializer-dry" );
+    setSlider( o_spat_band5_sld, o_spat_band5_fld, "spatializer-damp" );
+
+#undef setSlider
 }
 
 - (IBAction)resetSpatializerValues:(id)sender
 {
-    config_PutFloat( p_intf, "spatializer-roomsize", 1.050000 );
-    config_PutFloat( p_intf, "spatializer-width", 10.000000 );
-    config_PutFloat( p_intf, "spatializer-wet", 3.000000 );
-    config_PutFloat( p_intf, "spatializer-dry", 2.000000 );
-    config_PutFloat( p_intf, "spatializer-damp", 1.000000 );
+    config_PutFloat( p_intf, "spatializer-roomsize", .85 );
+    config_PutFloat( p_intf, "spatializer-width", 1. );
+    config_PutFloat( p_intf, "spatializer-wet", .4 );
+    config_PutFloat( p_intf, "spatializer-dry", .5 );
+    config_PutFloat( p_intf, "spatializer-damp", .5 );
 
     audio_output_t * p_aout = getAout();
     if (p_aout) {
-        var_SetFloat( p_aout, "spatializer-roomsize", 1.050000 );
-        var_SetFloat( p_aout, "spatializer-width", 10.000000 );
-        var_SetFloat( p_aout, "spatializer-wet", 3.000000 );
-        var_SetFloat( p_aout, "spatializer-dry", 2.000000 );
-        var_SetFloat( p_aout, "spatializer-damp", 1.000000 );
+        var_SetFloat( p_aout, "spatializer-roomsize", .85 );
+        var_SetFloat( p_aout, "spatializer-width", 1. );
+        var_SetFloat( p_aout, "spatializer-wet", .4 );
+        var_SetFloat( p_aout, "spatializer-dry", .5 );
+        var_SetFloat( p_aout, "spatializer-damp", .5 );
         vlc_object_release( p_aout );
     }
     [self resetSpatializer];
@@ -581,10 +582,10 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
         value = "spatializer-damp";
 
     if( p_aout ) {
-        var_SetFloat( p_aout, value, [sender floatValue] );
+        var_SetFloat( p_aout, value, [sender floatValue] / 10. );
         vlc_object_release( p_aout );
     }
-    config_PutFloat( p_intf, value, [sender floatValue] );
+    config_PutFloat( p_intf, value, [sender floatValue] / 10. );
 
     if( sender == o_spat_band1_sld )
         [o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];



More information about the vlc-commits mailing list