summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-11-18 17:07:07 +0000
committerCarl Hetherington <cth@carlh.net>2015-11-18 20:52:20 +0000
commit419afb743ad2aaf1ea301356ac09f9a26ee15567 (patch)
treea90a3776b0919871750c173c2bb753321ddf7282 /src/wx
parente07926b8b0d3d93c2b670aea4b49230170a3532b (diff)
Basic (untested) ebur128 (#368).
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/audio_dialog.cc67
-rw-r--r--src/wx/audio_dialog.h9
-rw-r--r--src/wx/audio_panel.cc4
3 files changed, 56 insertions, 24 deletions
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc
index 8e672150e..e9dee3dac 100644
--- a/src/wx/audio_dialog.cc
+++ b/src/wx/audio_dialog.cc
@@ -52,9 +52,15 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Au
wxBoxSizer* left = new wxBoxSizer (wxVERTICAL);
_plot = new AudioPlot (this);
- left->Add (_plot, 1, wxALL | wxEXPAND, 12);
- _peak_time = new wxStaticText (this, wxID_ANY, wxT (""));
- left->Add (_peak_time, 0, wxALL, 12);
+ left->Add (_plot, 1, wxTOP | wxEXPAND, 12);
+ _sample_peak = new wxStaticText (this, wxID_ANY, wxT (""));
+ left->Add (_sample_peak, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
+ _true_peak = new wxStaticText (this, wxID_ANY, wxT (""));
+ left->Add (_true_peak, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
+ _integrated_loudness = new wxStaticText (this, wxID_ANY, wxT (""));
+ left->Add (_integrated_loudness, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
+ _loudness_range = new wxStaticText (this, wxID_ANY, wxT (""));
+ left->Add (_loudness_range, 0, wxTOP, DCPOMATIC_SIZER_Y_GAP);
lr_sizer->Add (left, 1, wxALL, 12);
@@ -153,7 +159,7 @@ AudioDialog::try_to_load_analysis ()
_plot->set_analysis (_analysis);
_plot->set_gain_correction (_analysis->gain_correction (_playlist));
- setup_peak_time ();
+ setup_statistics ();
/* Set up some defaults if no check boxes are checked */
@@ -223,7 +229,7 @@ AudioDialog::content_changed (int p)
change, rather than recalculating everything.
*/
_plot->set_gain_correction (_analysis->gain_correction (_playlist));
- setup_peak_time ();
+ setup_statistics ();
} else {
try_to_load_analysis ();
}
@@ -250,9 +256,9 @@ AudioDialog::smoothing_changed ()
}
void
-AudioDialog::setup_peak_time ()
+AudioDialog::setup_statistics ()
{
- if (!_analysis || !_analysis->peak ()) {
+ if (!_analysis) {
return;
}
@@ -261,20 +267,43 @@ AudioDialog::setup_peak_time ()
return;
}
- float const peak_dB = 20 * log10 (_analysis->peak().get()) + _analysis->gain_correction (_playlist);
+ if (static_cast<bool>(_analysis->sample_peak ())) {
- _peak_time->SetLabel (
- wxString::Format (
- _("Peak is %.2fdB at %s"),
- peak_dB,
- time_to_timecode (_analysis->peak_time().get(), film->video_frame_rate ()).data ()
- )
- );
+ float const peak_dB = 20 * log10 (_analysis->sample_peak().get()) + _analysis->gain_correction (_playlist);
- if (peak_dB > -3) {
- _peak_time->SetForegroundColour (wxColour (255, 0, 0));
- } else {
- _peak_time->SetForegroundColour (wxColour (0, 0, 0));
+ _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));
+ }
+ }
+
+ if (static_cast<bool>(_analysis->integrated_loudness ())) {
+ _integrated_loudness->SetLabel (wxString::Format (_("Integrated loudness %.2f LUFS"), _analysis->integrated_loudness().get()));
+ }
+
+ if (static_cast<bool>(_analysis->loudness_range ())) {
+ _loudness_range->SetLabel (wxString::Format (_("Loudness range %.2f LRA"), _analysis->loudness_range().get()));
}
}
diff --git a/src/wx/audio_dialog.h b/src/wx/audio_dialog.h
index 588f71159..0f791dc16 100644
--- a/src/wx/audio_dialog.h
+++ b/src/wx/audio_dialog.h
@@ -1,5 +1,5 @@
/*
- Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2013-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -41,14 +41,17 @@ private:
void smoothing_changed ();
void try_to_load_analysis ();
void analysis_finished ();
- void setup_peak_time ();
+ void setup_statistics ();
boost::shared_ptr<AudioAnalysis> _analysis;
boost::weak_ptr<Film> _film;
int _channels;
boost::shared_ptr<const Playlist> _playlist;
AudioPlot* _plot;
- wxStaticText* _peak_time;
+ wxStaticText* _sample_peak;
+ wxStaticText* _true_peak;
+ wxStaticText* _integrated_loudness;
+ wxStaticText* _loudness_range;
wxCheckBox* _channel_checkbox[MAX_DCP_AUDIO_CHANNELS];
wxCheckBox* _type_checkbox[AudioPoint::COUNT];
wxSlider* _smoothing;
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc
index b1904107b..ff62acc67 100644
--- a/src/wx/audio_panel.cc
+++ b/src/wx/audio_panel.cc
@@ -303,8 +303,8 @@ AudioPanel::setup_peak ()
playlist->add (sel.front ());
try {
shared_ptr<AudioAnalysis> analysis (new AudioAnalysis (_parent->film()->audio_analysis_path (playlist)));
- if (analysis->peak ()) {
- float const peak_dB = 20 * log10 (analysis->peak().get()) + analysis->gain_correction (playlist);
+ if (analysis->sample_peak ()) {
+ float const peak_dB = 20 * log10 (analysis->sample_peak().get()) + analysis->gain_correction (playlist);
if (peak_dB > -3) {
alert = true;
}