Engine: pipe-in the EBU R 128 loudness normalization gain stuff

The idea is that Integrated Loudness is an integral part
of the song, much like knowing it's beginning / ending
in the file, and we must handle it the exact same way,
and pipe it through all the way.

At the same time, `EngineBase` knows Target Level (from settings),
and these two combined tell us the Gain needed to normalize the
Loudness of the particular Song (`EngineBase::Load()` does that).
So the actual backend only needs to handle the Volume.

We don't currently support changing Target Level on the fly.
We don't currently support changing Loudness-normalizing Gain on the fly.

This does not handle the case when the song is loaded from URL
and thus the EBU R 128 measures, that exist, are not nessesairly correct.
This commit is contained in:
Roman Lebedev
2023-06-27 05:05:01 +03:00
committed by Jonas Kvinge
parent 40ef3191fc
commit 13d6cf201f
10 changed files with 63 additions and 19 deletions

View File

@@ -98,9 +98,12 @@ bool VLCEngine::Init() {
}
bool VLCEngine::Load(const QUrl &media_url, const QUrl &stream_url, const EngineBase::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec) {
bool VLCEngine::Load(const QUrl &media_url, const QUrl &stream_url, const EngineBase::TrackChangeFlags change, const bool force_stop_at_end, const quint64 beginning_nanosec, const qint64 end_nanosec, const std::optional<double> ebur128_integrated_loudness_lufs) {
// FIXME: why is this not calling `EngineBase::Load()`?
Q_UNUSED(media_url);
Q_UNUSED(ebur128_integrated_loudness_lufs);
Q_UNUSED(change);
Q_UNUSED(force_stop_at_end);
Q_UNUSED(beginning_nanosec);