Commit 09c3cc58 authored by Max Kellermann's avatar Max Kellermann

ReplayGainInfo: add method Get()

parent 7ef31f84
......@@ -56,6 +56,10 @@ struct ReplayGainInfo {
tuples[REPLAY_GAIN_TRACK].IsDefined();
}
const ReplayGainTuple &Get(ReplayGainMode mode) const {
return tuples[mode];
}
void Clear() {
tuples[REPLAY_GAIN_ALBUM].Clear();
tuples[REPLAY_GAIN_TRACK].Clear();
......
......@@ -597,7 +597,7 @@ DecoderBridge::SubmitReplayGain(const ReplayGainInfo *new_replay_gain_info)
if (rgm != REPLAY_GAIN_ALBUM)
rgm = REPLAY_GAIN_TRACK;
const auto &tuple = new_replay_gain_info->tuples[rgm];
const auto &tuple = new_replay_gain_info->Get(rgm);
const auto scale =
tuple.CalculateScale(replay_gain_preamp,
replay_gain_missing_preamp,
......
......@@ -140,7 +140,7 @@ ReplayGainFilter::Update()
{
unsigned volume = PCM_VOLUME_1;
if (mode != REPLAY_GAIN_OFF) {
const auto &tuple = info.tuples[mode];
const auto &tuple = info.Get(mode);
float scale = tuple.CalculateScale(replay_gain_preamp,
replay_gain_missing_preamp,
replay_gain_limit);
......
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