From 09c3cc58e4bd7ce32f3c7368339f8fc537a0dbdf Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 24 Nov 2016 16:50:55 +0100 Subject: [PATCH] ReplayGainInfo: add method Get() --- src/ReplayGainInfo.hxx | 4 ++++ src/decoder/Bridge.cxx | 2 +- src/filter/plugins/ReplayGainFilterPlugin.cxx | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ReplayGainInfo.hxx b/src/ReplayGainInfo.hxx index 932f48dd0..baa041bf7 100644 --- a/src/ReplayGainInfo.hxx +++ b/src/ReplayGainInfo.hxx @@ -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(); diff --git a/src/decoder/Bridge.cxx b/src/decoder/Bridge.cxx index 25f169d41..633f2a55a 100644 --- a/src/decoder/Bridge.cxx +++ b/src/decoder/Bridge.cxx @@ -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, diff --git a/src/filter/plugins/ReplayGainFilterPlugin.cxx b/src/filter/plugins/ReplayGainFilterPlugin.cxx index 18b4c9932..1f72a12ae 100644 --- a/src/filter/plugins/ReplayGainFilterPlugin.cxx +++ b/src/filter/plugins/ReplayGainFilterPlugin.cxx @@ -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);