diff --git a/src/ReplayGainInfo.hxx b/src/ReplayGainInfo.hxx index b2664abc3..685bfe9a0 100644 --- a/src/ReplayGainInfo.hxx +++ b/src/ReplayGainInfo.hxx @@ -38,6 +38,10 @@ struct ReplayGainTuple { return gain > -100; } + static constexpr ReplayGainTuple Undefined() noexcept { + return {-200.0f, 0.0f}; + } + gcc_pure float CalculateScale(const ReplayGainConfig &config) const noexcept; }; @@ -49,6 +53,13 @@ struct ReplayGainInfo { return track.IsDefined() || album.IsDefined(); } + static constexpr ReplayGainInfo Undefined() noexcept { + return { + ReplayGainTuple::Undefined(), + ReplayGainTuple::Undefined(), + }; + } + const ReplayGainTuple &Get(ReplayGainMode mode) const noexcept { return mode == ReplayGainMode::ALBUM ? (album.IsDefined() ? album : track)