Commit d4e655fa authored by Sandeep Kumar's avatar Sandeep Kumar Committed by Rémi Denis-Courmont

aout: Increase/decrease volume in steps of 5%

Signed-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent 1e681020
......@@ -88,7 +88,7 @@ SoundWidget::SoundWidget( QWidget *_parent, intf_thread_t * _p_intf,
if( b_shiny )
{
volumeSlider = new SoundSlider( this,
config_GetInt( p_intf, "volume-step" ),
config_GetFloat( p_intf, "volume-step" ),
var_InheritString( p_intf, "qt-slider-colours" ),
var_InheritInteger( p_intf, "qt-max-volume") );
}
......
......@@ -441,7 +441,7 @@ bool SeekSlider::isAnimationRunning() const
#define WHEIGHT 22 // px
#define SOUNDMIN 0 // %
SoundSlider::SoundSlider( QWidget *_parent, int _i_step,
SoundSlider::SoundSlider( QWidget *_parent, float _i_step,
char *psz_colors, int max )
: QAbstractSlider( _parent )
{
......
......@@ -130,7 +130,7 @@ class SoundSlider : public QAbstractSlider
{
Q_OBJECT
public:
SoundSlider(QWidget *_parent, int _i_step, char *psz_colors, int max = SOUNDMAX );
SoundSlider(QWidget *_parent, float _i_step, char *psz_colors, int max = SOUNDMAX );
void setMuted( bool ); /* Set Mute status */
protected:
......
......@@ -35,7 +35,7 @@
Volume::Volume( intf_thread_t *pIntf ): VarPercent( pIntf )
{
// compute preferred step in [0.,1.] range
m_step = (float)config_GetInt( pIntf, "volume-step" )
m_step = config_GetFloat( pIntf, "volume-step" )
/ (float)AOUT_VOLUME_MAX;
// set current volume from the playlist
......
......@@ -142,7 +142,7 @@ static const char *const ppsz_snap_formats[] =
#define VOLUME_STEP_TEXT N_("Audio output volume step")
#define VOLUME_STEP_LONGTEXT N_( \
"The step size of the volume is adjustable using this option.")
#define AOUT_VOLUME_STEP 13
#define AOUT_VOLUME_STEP 12.8
#define VOLUME_SAVE_TEXT N_( "Remember the audio volume" )
#define VOLUME_SAVE_LONGTEXT N_( \
......@@ -1460,7 +1460,7 @@ vlc_module_begin ()
add_float( "gain", 1., GAIN_TEXT, GAIN_LONGTEXT, true )
change_float_range( 0., 8. )
add_obsolete_integer( "volume" ) /* since 2.1.0 */
add_integer( "volume-step", AOUT_VOLUME_STEP, VOLUME_STEP_TEXT,
add_float( "volume-step", AOUT_VOLUME_STEP, VOLUME_STEP_TEXT,
VOLUME_STEP_LONGTEXT, true )
change_integer_range( 1, AOUT_VOLUME_DEFAULT )
add_bool( "volume-save", true, VOLUME_SAVE_TEXT, VOLUME_SAVE_TEXT, true )
......
......@@ -76,7 +76,7 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
{
int ret = -1;
value *= var_InheritInteger (pl, "volume-step");
float delta = value * var_InheritFloat (pl, "volume-step");
audio_output_t *aout = playlist_GetAout (pl);
if (aout != NULL)
......@@ -84,7 +84,7 @@ int playlist_VolumeUp (playlist_t *pl, int value, float *volp)
float vol = aout_VolumeGet (aout);
if (vol >= 0.)
{
vol += value / (float)AOUT_VOLUME_DEFAULT;
vol += delta / (float)AOUT_VOLUME_DEFAULT;
if (vol < 0.)
vol = 0.;
if (vol > 2.)
......
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