ReplayGainInfo: add static method Undefined()
This commit is contained in:
parent
5ef645df97
commit
496f88653d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue