summaryrefslogtreecommitdiff
path: root/src/ReplayGainInfo.hxx
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2019-09-25 21:27:31 +0200
committerMax Kellermann <max@musicpd.org>2019-09-25 21:27:31 +0200
commit0643b5abad0f2ea4b69b02e9873cc0450963a8cd (patch)
treef49c52d47fbf3896363ca5bae2b8ce21ffbc7973 /src/ReplayGainInfo.hxx
parentd63e2c26416de3c65e4d6b71c2ef859b60372bfa (diff)
parent964804a4c2cdd65f2bf08b3bfde063e0c126fd4c (diff)
Merge tag 'v0.21.15'
release v0.21.15
Diffstat (limited to 'src/ReplayGainInfo.hxx')
-rw-r--r--src/ReplayGainInfo.hxx11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ReplayGainInfo.hxx b/src/ReplayGainInfo.hxx
index 71adcf14a..494c1cd6d 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)