filter/ReplayGain: convert pointers to references
This commit is contained in:
parent
86e8b8c10d
commit
bfb0897b54
@ -189,26 +189,26 @@ const FilterPlugin replay_gain_filter_plugin = {
|
||||
};
|
||||
|
||||
void
|
||||
replay_gain_filter_set_mixer(PreparedFilter *_filter, Mixer *mixer,
|
||||
replay_gain_filter_set_mixer(PreparedFilter &_filter, Mixer *mixer,
|
||||
unsigned base)
|
||||
{
|
||||
PreparedReplayGainFilter *filter = (PreparedReplayGainFilter *)_filter;
|
||||
auto &filter = (PreparedReplayGainFilter &)_filter;
|
||||
|
||||
filter->SetMixer(mixer, base);
|
||||
filter.SetMixer(mixer, base);
|
||||
}
|
||||
|
||||
void
|
||||
replay_gain_filter_set_info(Filter *_filter, const ReplayGainInfo *info)
|
||||
replay_gain_filter_set_info(Filter &_filter, const ReplayGainInfo *info)
|
||||
{
|
||||
ReplayGainFilter *filter = (ReplayGainFilter *)_filter;
|
||||
auto &filter = (ReplayGainFilter &)_filter;
|
||||
|
||||
filter->SetInfo(info);
|
||||
filter.SetInfo(info);
|
||||
}
|
||||
|
||||
void
|
||||
replay_gain_filter_set_mode(Filter *_filter, ReplayGainMode mode)
|
||||
replay_gain_filter_set_mode(Filter &_filter, ReplayGainMode mode)
|
||||
{
|
||||
ReplayGainFilter *filter = (ReplayGainFilter *)_filter;
|
||||
auto &filter = (ReplayGainFilter &)_filter;
|
||||
|
||||
filter->SetMode(mode);
|
||||
filter.SetMode(mode);
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ class Mixer;
|
||||
* (including).
|
||||
*/
|
||||
void
|
||||
replay_gain_filter_set_mixer(PreparedFilter *_filter, Mixer *mixer,
|
||||
replay_gain_filter_set_mixer(PreparedFilter &_filter, Mixer *mixer,
|
||||
unsigned base);
|
||||
|
||||
/**
|
||||
@ -45,9 +45,9 @@ replay_gain_filter_set_mixer(PreparedFilter *_filter, Mixer *mixer,
|
||||
* gain data is available for the current song
|
||||
*/
|
||||
void
|
||||
replay_gain_filter_set_info(Filter *filter, const ReplayGainInfo *info);
|
||||
replay_gain_filter_set_info(Filter &filter, const ReplayGainInfo *info);
|
||||
|
||||
void
|
||||
replay_gain_filter_set_mode(Filter *filter, ReplayGainMode mode);
|
||||
replay_gain_filter_set_mode(Filter &filter, ReplayGainMode mode);
|
||||
|
||||
#endif
|
||||
|
@ -249,7 +249,7 @@ audio_output_setup(EventLoop &event_loop, AudioOutput &ao,
|
||||
|
||||
if (strcmp(replay_gain_handler, "mixer") == 0) {
|
||||
if (ao.mixer != nullptr)
|
||||
replay_gain_filter_set_mixer(ao.prepared_replay_gain_filter,
|
||||
replay_gain_filter_set_mixer(*ao.prepared_replay_gain_filter,
|
||||
ao.mixer, 100);
|
||||
else
|
||||
FormatError(output_domain,
|
||||
|
@ -349,11 +349,11 @@ ao_chunk_data(AudioOutput *ao, const MusicChunk *chunk,
|
||||
assert(data.size % ao->in_audio_format.GetFrameSize() == 0);
|
||||
|
||||
if (!data.IsEmpty() && replay_gain_filter != nullptr) {
|
||||
replay_gain_filter_set_mode(replay_gain_filter,
|
||||
replay_gain_filter_set_mode(*replay_gain_filter,
|
||||
ao->replay_gain_mode);
|
||||
|
||||
if (chunk->replay_gain_serial != *replay_gain_serial_p) {
|
||||
replay_gain_filter_set_info(replay_gain_filter,
|
||||
replay_gain_filter_set_info(*replay_gain_filter,
|
||||
chunk->replay_gain_serial != 0
|
||||
? &chunk->replay_gain_info
|
||||
: nullptr);
|
||||
|
Loading…
Reference in New Issue
Block a user