[vlc-devel] commit: Skins: set the maximum volume to 1024, not 512 (Geoffroy Couprie )
Geoffroy Couprie
geo.couprie at gmail.com
Sun Dec 27 00:46:35 CET 2009
On Sun, Dec 27, 2009 at 12:42 AM, git version control <git at videolan.org> wrote:
> vlc | branch: master | Geoffroy Couprie <geal at videolan.org> | Sun Dec 27 00:39:10 2009 +0100| [20abd0db808e293360bd0172bc4ed78639257cba] | committer: Geoffroy Couprie
>
> Skins: set the maximum volume to 1024, not 512
>
> close #2089
>
>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=20abd0db808e293360bd0172bc4ed78639257cba
> ---
>
> modules/gui/skins2/src/vlcproc.cpp | 4 ++--
> modules/gui/skins2/vars/volume.cpp | 5 ++---
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/modules/gui/skins2/src/vlcproc.cpp b/modules/gui/skins2/src/vlcproc.cpp
> index 926f049..0ebde91 100644
> --- a/modules/gui/skins2/src/vlcproc.cpp
> +++ b/modules/gui/skins2/src/vlcproc.cpp
> @@ -682,7 +682,7 @@ void VlcProc::on_volume_changed( vlc_object_t* p_obj, vlc_value_t newVal )
>
> audio_volume_t volume;
> aout_VolumeGet( pPlaylist, &volume );
> - SET_VOLUME( m_cVarVolume, (double)volume * 2.0 / AOUT_VOLUME_MAX, false );
> + SET_VOLUME( m_cVarVolume, (double)volume / AOUT_VOLUME_MAX, false );
> SET_BOOL( m_cVarMute, volume == 0 );
> }
>
> @@ -775,7 +775,7 @@ void VlcProc::init_variables()
>
> audio_volume_t volume;
> aout_VolumeGet( pPlaylist, &volume );
> - SET_VOLUME( m_cVarVolume, (double)volume * 2.0 / AOUT_VOLUME_MAX, false );
> + SET_VOLUME( m_cVarVolume, (double)volume / AOUT_VOLUME_MAX, false );
> SET_BOOL( m_cVarMute, volume == 0 );
>
> update_equalizer();
> diff --git a/modules/gui/skins2/vars/volume.cpp b/modules/gui/skins2/vars/volume.cpp
> index 075057d..2809c0d 100644
> --- a/modules/gui/skins2/vars/volume.cpp
> +++ b/modules/gui/skins2/vars/volume.cpp
> @@ -37,7 +37,7 @@ Volume::Volume( intf_thread_t *pIntf ): VarPercent( pIntf )
> audio_volume_t val;
>
> aout_VolumeGet( getIntf()->p_sys->p_playlist, &val );
> - VarPercent::set( val * 2.0 / AOUT_VOLUME_MAX );
> + VarPercent::set( val / AOUT_VOLUME_MAX );
> }
>
>
> @@ -48,10 +48,9 @@ void Volume::set( float percentage, bool updateVLC )
> (int)(percentage * AOUT_VOLUME_MAX) )
> {
> VarPercent::set( percentage );
> -
> if( updateVLC )
> aout_VolumeSet( getIntf()->p_sys->p_playlist,
> - (int)(get() * AOUT_VOLUME_MAX / 2.0) );
> + (int)(get() * AOUT_VOLUME_MAX) );
> }
> }
>
>
BTW, what is the real maximum? on Qt, the maximum is 200%, but it
means 512. And in the preferences window, 1024 seems to correspond to
400%.
Is the 400% setting unusable to protect users that buy audio cards
with crappy drivers?
More information about the vlc-devel
mailing list