summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-09-13 19:46:39 +0200
committerMax Kellermann <max@musicpd.org>2019-09-13 19:46:39 +0200
commit496f88653d9166338d37fb94cc10cffd6af196d5 (patch)
tree81b2d9f06003e73fc7350048e42a8f0dfde6a907
parent5ef645df97b72263adc5b17059bde13c0b1f1b2e (diff)
ReplayGainInfo: add static method Undefined()
-rw-r--r--src/ReplayGainInfo.hxx11
1 files changed, 11 insertions, 0 deletions
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)