Commit 496f8865 authored by Max Kellermann's avatar Max Kellermann

ReplayGainInfo: add static method Undefined()

parent 5ef645df
...@@ -38,6 +38,10 @@ struct ReplayGainTuple { ...@@ -38,6 +38,10 @@ struct ReplayGainTuple {
return gain > -100; return gain > -100;
} }
static constexpr ReplayGainTuple Undefined() noexcept {
return {-200.0f, 0.0f};
}
gcc_pure gcc_pure
float CalculateScale(const ReplayGainConfig &config) const noexcept; float CalculateScale(const ReplayGainConfig &config) const noexcept;
}; };
...@@ -49,6 +53,13 @@ struct ReplayGainInfo { ...@@ -49,6 +53,13 @@ struct ReplayGainInfo {
return track.IsDefined() || album.IsDefined(); return track.IsDefined() || album.IsDefined();
} }
static constexpr ReplayGainInfo Undefined() noexcept {
return {
ReplayGainTuple::Undefined(),
ReplayGainTuple::Undefined(),
};
}
const ReplayGainTuple &Get(ReplayGainMode mode) const noexcept { const ReplayGainTuple &Get(ReplayGainMode mode) const noexcept {
return mode == ReplayGainMode::ALBUM return mode == ReplayGainMode::ALBUM
? (album.IsDefined() ? album : track) ? (album.IsDefined() ? album : track)
......
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