-
- float peak_dB = 20 * log10 (_analysis->peak().get());
-
- _peak_time->SetLabel (
- wxString::Format (
- _("Peak is %.2fdB at %s"),
- peak_dB,
- time_to_timecode (_analysis->peak_time().get(), film->video_frame_rate ()).data ()
- )
- );
-
- if (peak_dB > -3) {
- _peak_time->SetForegroundColour (wxColour (255, 0, 0));
- } else {
- _peak_time->SetForegroundColour (wxColour (0, 0, 0));
+
+ if (static_cast<bool>(_analysis->sample_peak ())) {
+
+ float const peak_dB = 20 * log10 (_analysis->sample_peak().get()) + _analysis->gain_correction (_playlist);
+
+ _sample_peak->SetLabel (
+ wxString::Format (
+ _("Sample peak is %.2fdB at %s"),
+ peak_dB,
+ time_to_timecode (_analysis->sample_peak_time().get(), film->video_frame_rate ()).data ()
+ )
+ );
+
+ if (peak_dB > -3) {
+ _sample_peak->SetForegroundColour (wxColour (255, 0, 0));
+ } else {
+ _sample_peak->SetForegroundColour (wxColour (0, 0, 0));
+ }
+ }
+
+ if (static_cast<bool>(_analysis->true_peak ())) {
+ float const peak_dB = 20 * log10 (_analysis->true_peak().get()) + _analysis->gain_correction (_playlist);
+
+ _true_peak->SetLabel (wxString::Format (_("True peak is %.2fdB"), peak_dB));
+
+ if (peak_dB > -3) {
+ _true_peak->SetForegroundColour (wxColour (255, 0, 0));
+ } else {
+ _true_peak->SetForegroundColour (wxColour (0, 0, 0));
+ }
+ }
+
+ /* XXX: check whether it's ok to add dB gain to these quantities */
+
+ if (static_cast<bool>(_analysis->integrated_loudness ())) {
+ _integrated_loudness->SetLabel (
+ wxString::Format (
+ _("Integrated loudness %.2f LUFS"),
+ _analysis->integrated_loudness().get() + _analysis->gain_correction (_playlist)
+ )
+ );