X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Faudio_dialog.cc;h=4cd308ab1cebf852b93d782064f69a5e11d42f02;hb=b39dbb7cf1b0352cf0eb3af4bf4929556355bff5;hp=c64f64e31eb4104ce612f9ca24cd98d3212b66f1;hpb=cf2ed48d21ddbc32bda262064480e88e69dc031a;p=dcpomatic.git diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index c64f64e31..4cd308ab1 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -56,7 +56,7 @@ using namespace boost::placeholders; * @param film Film we are using. * @param content Content to analyse, or 0 to analyse all of the film's audio. */ -AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film, weak_ptr viewer, shared_ptr content) +AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film, FilmViewer& viewer, shared_ptr content) : wxDialog ( parent, wxID_ANY, @@ -73,7 +73,6 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film, weak_ptraudio_channels ()) , _plot (nullptr) @@ -115,7 +114,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film, weak_ptrSetForegroundColour(wxColour(_plot->colour(i))); right->Add (_channel_checkbox[i], 0, wxEXPAND | wxALL, 3); - _channel_checkbox[i]->Bind (wxEVT_CHECKBOX, boost::bind (&AudioDialog::channel_clicked, this, _1)); + _channel_checkbox[i]->bind(&AudioDialog::channel_clicked, this, _1); } show_or_hide_channel_checkboxes (); @@ -134,7 +133,7 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr film, weak_ptrAdd (_type_checkbox[i], 0, wxEXPAND | wxALL, 3); - _type_checkbox[i]->Bind (wxEVT_CHECKBOX, boost::bind (&AudioDialog::type_clicked, this, _1)); + _type_checkbox[i]->bind(&AudioDialog::type_clicked, this, _1); } { @@ -400,10 +399,13 @@ AudioDialog::setup_statistics () ) ); + wxColour const peaking = *wxRED; + wxColour const not_peaking = gui_is_dark() ? *wxWHITE : *wxBLACK; + if (peak_dB > -3) { - _sample_peak->SetForegroundColour (wxColour (255, 0, 0)); + _sample_peak->SetForegroundColour(peaking); } else { - _sample_peak->SetForegroundColour (wxColour (0, 0, 0)); + _sample_peak->SetForegroundColour(not_peaking); } if (_analysis->overall_true_peak()) { @@ -413,9 +415,9 @@ AudioDialog::setup_statistics () _true_peak->SetLabel (wxString::Format (_("True peak is %.2fdB"), peak_dB)); if (peak_dB > -3) { - _true_peak->SetForegroundColour (wxColour (255, 0, 0)); + _true_peak->SetForegroundColour(peaking); } else { - _true_peak->SetForegroundColour (wxColour (0, 0, 0)); + _true_peak->SetForegroundColour(not_peaking); } }