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") );
}
#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 )
{
{
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:
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
#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_( \
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 )
{
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)
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.)