Song: add pretty-printers for EBU R 128 Integrated Loudness and Loudness Range fields

They end up being used in a quite a number of places later on,
it makes sense to have them in a common place.

Integrated Loudness (LUFS) is *usually* negative, so we really want to
always print a sign. But Loudness Range is non-negative.

I think it makes sense to print one or at most two decimal places for these.
This commit is contained in:
Roman Lebedev
2023-06-27 04:56:07 +03:00
committed by Jonas Kvinge
parent 459c4c5d86
commit e589486907
2 changed files with 26 additions and 0 deletions

View File

@@ -225,6 +225,12 @@ class Song {
const QUrl &stream_url() const;
static QString Ebur128LoudnessLUFSToText(const std::optional<double> &v);
QString Ebur128LoudnessLUFSToText() const;
static QString Ebur128LoudnessRangeLUToText(const std::optional<double> &v);
QString Ebur128LoudnessRangeLUToText() const;
// Setters
void set_id(const int id);
void set_valid(const bool v);