[vlc-devel] commit: macosx: volume needs to be stored in absolute numbers instead of percentages. If you don't do this, the user will get a quite different noise experience ... ( Felix Paul Kühne )

git version control git at videolan.org
Tue Jun 2 23:07:29 CEST 2009


vlc | branch: 1.0-bugfix | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jun  2 23:06:20 2009 +0200| [c27a7ed8ff07510b66810a9ff55e72ec3325f8f0] | committer: Felix Paul Kühne 

macosx: volume needs to be stored in absolute numbers instead of percentages. If you don't do this, the user will get a quite different noise experience...

Closes #2805

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

 modules/gui/macosx/simple_prefs.m |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/simple_prefs.m b/modules/gui/macosx/simple_prefs.m
index 2f0b7b2..7423ac7 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -418,8 +418,9 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
      * audio settings *
      ******************/
     [o_audio_enable_ckb setState: config_GetInt( p_intf, "audio" )];
-    [o_audio_vol_fld setIntValue: config_GetInt( p_intf, "volume" )];
-    [o_audio_vol_sld setIntValue: config_GetInt( p_intf, "volume" )];
+    i = (config_GetInt( p_intf, "volume" ) * 0.390625);
+    [o_audio_vol_fld setIntValue: i];
+    [o_audio_vol_sld setIntValue: i];
 
     [o_audio_spdif_ckb setState: config_GetInt( p_intf, "spdif" )];
 
@@ -742,7 +743,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
     if( b_audioSettingChanged )
     {
         config_PutInt( p_intf, "audio", [o_audio_enable_ckb state] );
-        config_PutInt( p_intf, "volume", [o_audio_vol_sld intValue] );
+        config_PutInt( p_intf, "volume", ([o_audio_vol_sld intValue] * 2.56));
+        NSLog( @"slider=%i, pref=%i", [o_audio_vol_sld intValue], config_GetInt( p_intf, "volume" ));
         config_PutInt( p_intf, "spdif", [o_audio_spdif_ckb state] );
 
         SaveIntList( o_audio_dolby_pop, "force-dolby-surround" );




More information about the vlc-devel mailing list