void (*time_report)(audio_output_t *, mtime_t);
void (*volume_report)(audio_output_t *, float);
void (*mute_report)(audio_output_t *, bool);
+ int (*gain_request)(audio_output_t *, float);
} event;
};
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);
+}
+
static inline void aout_VolumeReport(audio_output_t *aout, float volume)
{
aout->event.volume_report(aout, volume);
aout->event.mute_report(aout, mute);
}
-static inline void aout_TimeReport(audio_output_t *aout, mtime_t date)
+static inline int aout_GainRequest(audio_output_t *aout, float gain)
{
- aout->event.time_report(aout, date);
+ return aout->event.gain_request(aout, gain);
}
VLC_API int aout_ChannelsRestart( vlc_object_t *, const char *, vlc_value_t, vlc_value_t, void * );
var_SetBool (aout, "mute", mute);
}
+static int aout_OutputGainRequest (audio_output_t *aout, float gain)
+{
+ aout_owner_t *owner = aout_owner (aout);
+
+ aout_assert_locked (aout);
+ aout_volume_SetVolume (owner->volume, gain);
+ /* XXX: ideally, return -1 if format cannot be amplified */
+ return 0;
+}
+
/*****************************************************************************
* aout_OutputNew : allocate a new output and rework the filter pipeline
*****************************************************************************
p_aout->event.time_report = aout_OutputTimeReport;
p_aout->event.volume_report = aout_OutputVolumeReport;
p_aout->event.mute_report = aout_OutputMuteReport;
+ p_aout->event.gain_request = aout_OutputGainRequest;
/* Find the best output plug-in. */
owner->module = module_need (p_aout, "audio output", "$aout", false);