Commit 5e06ffd4 authored by David Fuhrmann's avatar David Fuhrmann

macosx: also round volume percents

This prevent cases in which the percent value is one smaller than the
previous adjusted value.
parent f2bc92ad
......@@ -538,7 +538,7 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
[o_audio_vol_sld setEnabled: YES];
i = config_GetInt( p_intf, "volume" );
i = i * 200 / AOUT_VOLUME_MAX;
i = i * 200.0 / AOUT_VOLUME_MAX + 0.5;
[o_audio_vol_sld setIntValue: i];
[o_audio_vol_fld setIntValue: i];
}
......@@ -899,7 +899,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
{
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 );
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] );
config_PutInt( p_intf, "spdif", [o_audio_spdif_ckb state] );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment