[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:09:23 CEST 2009


vlc | branch: 0.9-bugfix | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jun  2 23:06:20 2009 +0200| [ed02a7a8dbe971281ec381329665880be949a6d8] | 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=ed02a7a8dbe971281ec381329665880be949a6d8
---

 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 e63e7f8..d04baf5 100644
--- a/modules/gui/macosx/simple_prefs.m
+++ b/modules/gui/macosx/simple_prefs.m
@@ -415,8 +415,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" )];
 
@@ -747,7 +748,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