[vlc-commits] macosx/sprefs: adapt setting handling to the 2.1 volume API

Felix Paul Kühne git at videolan.org
Sat Dec 15 15:20:28 CET 2012


vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Sat Dec 15 15:20:07 2012 +0100| [5ff2c7a239dae052f4a4ed95fce3e0e5d66ccb64] | committer: Felix Paul Kühne

macosx/sprefs: adapt setting handling to the 2.1 volume API

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

 modules/gui/macosx/simple_prefs.m |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index fdaf529..11e4b002 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -472,8 +472,8 @@ static inline char * __config_GetLabel(vlc_object_t *p_this, const char *psz_nam
         [o_audio_vol_fld setEnabled: YES];
         [o_audio_vol_sld setEnabled: YES];
 
-        i = config_GetInt(p_intf, "volume");
-        i = i * 200.0 / AOUT_VOLUME_MAX + 0.5;
+        i = var_InheritInteger(p_intf, "auhal-volume");
+        i = i * 100. / AOUT_VOLUME_MAX;
         [o_audio_vol_sld setIntValue: i];
         [o_audio_vol_fld setIntValue: i];
     }
@@ -819,10 +819,11 @@ static inline void save_module_list(intf_thread_t * p_intf, id object, const cha
      ******************/
     if (b_audioSettingChanged) {
         config_PutInt(p_intf, "audio", [o_audio_enable_ckb state]);
-        if ([o_audio_vol_fld isEnabled])
-            config_PutInt(p_intf, "volume", [o_audio_vol_fld intValue] * AOUT_VOLUME_MAX / 200.0 + 0.5);
         config_PutInt(p_intf, "volume-save", [o_audio_autosavevol_yes_bcell state]);
+        var_SetBool(p_intf, "volume-save", [o_audio_autosavevol_yes_bcell state]);
         config_PutInt(p_intf, "spdif", [o_audio_spdif_ckb state]);
+        if ([o_audio_vol_fld isEnabled])
+            config_PutInt(p_intf, "auhal-volume", ([o_audio_vol_fld intValue] * 512) / 100);
 
         SaveIntList(o_audio_dolby_pop, "force-dolby-surround");
 



More information about the vlc-commits mailing list