Commit 7af353d6 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

aout: remove old volume back-end

parent e203c0ef
......@@ -223,8 +223,6 @@ VLC_API void aout_FormatPrint(vlc_object_t *, const char *,
#define aout_FormatPrint(o, t, f) aout_FormatPrint(VLC_OBJECT(o), t, f)
VLC_API const char * aout_FormatPrintChannels( const audio_sample_format_t * ) VLC_USED;
VLC_API void aout_VolumeSoftInit( audio_output_t * );
static inline void aout_TimeReport(audio_output_t *aout, mtime_t date)
{
aout->event.time_report(aout, date);
......
......@@ -98,12 +98,6 @@ typedef struct
filter_t *filters[AOUT_MAX_FILTERS];
int nb_filters;
struct
{
float volume;
bool mute;
} soft; /* temporary - TODO: move to output plugins */
vlc_atomic_t restart;
} aout_owner_t;
......
......@@ -100,8 +100,6 @@ int aout_VolumeSet (vlc_object_t *obj, float vol)
if (ret == 0)
{ /* update caller (input manager) volume */
var_SetInteger (obj, "volume", volume);
if (var_InheritBool (obj, "volume-save"))
config_PutInt (obj, "volume", volume);
}
return ret;
}
......
......@@ -335,56 +335,3 @@ void aout_OutputFlush( audio_output_t *aout, bool wait )
if( aout->pf_flush != NULL )
aout->pf_flush( aout, wait );
}
/*** Volume handling ***/
static int aout_SoftVolumeSet (audio_output_t *aout, float volume)
{
aout_owner_t *owner = aout_owner (aout);
aout_assert_locked (aout);
/* Cubic mapping from software volume to amplification factor.
* This provides a good tradeoff between low and high volume ranges.
*
* This code is only used for the VLC software mixer. If you change this
* formula, be sure to update the volume-capable plugins also.
*/
aout_VolumeReport (aout, volume);
volume = volume * volume * volume;
owner->soft.volume = volume;
aout_volume_SetVolume(owner->volume, owner->soft.mute ? 0.f : volume);
return 0;
}
static int aout_SoftMuteSet (audio_output_t *aout, bool mute)
{
aout_owner_t *owner = aout_owner (aout);
aout_assert_locked (aout);
aout_MuteReport (aout, mute);
owner->soft.mute = mute;
aout_volume_SetVolume(owner->volume, mute ? 0.f : owner->soft.volume);
return 0;
}
/**
* Configures the volume setter for software mixing
* and apply the default volume.
* @note Audio output plugins that cannot apply the volume
* should call this function during activation.
*/
void aout_VolumeSoftInit (audio_output_t *aout)
{
aout_owner_t *owner = aout_owner (aout);
long volume = var_GetInteger (aout, "volume");
bool mute = var_GetBool (aout, "mute");
aout_assert_locked (aout);
/* volume depends on mute and vice versa... bootstrapping mute is easier */
owner->soft.mute = mute;
aout->volume_set = aout_SoftVolumeSet;
aout->mute_set = aout_SoftMuteSet;
aout_SoftVolumeSet (aout, volume / (float)AOUT_VOLUME_DEFAULT);
aout_MuteReport (aout, mute);
}
......@@ -16,7 +16,6 @@ aout_VolumeSet
aout_VolumeUp
aout_MuteSet
aout_MuteGet
aout_VolumeSoftInit
block_Alloc
block_FifoCount
block_FifoEmpty
......
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