summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-07-29 22:30:38 +0200
committerCarl Hetherington <cth@carlh.net>2020-07-29 20:38:50 +0000
commitf9f0aa34954ca78983aa0057b594c64cf009c7de (patch)
tree05b56f15dceb9a4d1b3770b520f4b5112eef741d
parent5351a0970c7951190b4e518967040ad3caed70d6 (diff)
Don't display all possible channel checkboxes while the analysisv2.14.35
is running as clicking the higher ones will cause an assertion failure. Cherry-picked from 4b5e05b9845d609524328a88a81011b364e03a8a in v2.15.x.
-rw-r--r--src/wx/audio_dialog.cc25
-rw-r--r--src/wx/audio_dialog.h1
2 files changed, 18 insertions, 8 deletions
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc
index f4de9cd1a..fadda5951 100644
--- a/src/wx/audio_dialog.cc
+++ b/src/wx/audio_dialog.cc
@@ -106,6 +106,8 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
_channel_checkbox[i]->Bind (wxEVT_CHECKBOX, boost::bind (&AudioDialog::channel_clicked, this, _1));
}
+ show_or_hide_channel_checkboxes ();
+
{
wxStaticText* m = new StaticText (this, _("Type"));
m->SetFont (subheading_font);
@@ -163,6 +165,20 @@ AudioDialog::AudioDialog (wxWindow* parent, shared_ptr<Film> film, shared_ptr<Co
_plot->Cursor.connect (bind (&AudioDialog::set_cursor, this, _1, _2));
}
+
+void
+AudioDialog::show_or_hide_channel_checkboxes ()
+{
+ for (int i = 0; i < _channels; ++i) {
+ _channel_checkbox[i]->Show ();
+ }
+
+ for (int i = _channels; i < MAX_DCP_AUDIO_CHANNELS; ++i) {
+ _channel_checkbox[i]->Hide ();
+ }
+}
+
+
void
AudioDialog::try_to_load_analysis ()
{
@@ -211,14 +227,7 @@ AudioDialog::try_to_load_analysis ()
_plot->set_analysis (_analysis);
_plot->set_gain_correction (_analysis->gain_correction (_playlist));
setup_statistics ();
-
- for (int i = 0; i < _channels; ++i) {
- _channel_checkbox[i]->Show ();
- }
-
- for (int i = _channels; i < MAX_DCP_AUDIO_CHANNELS; ++i) {
- _channel_checkbox[i]->Hide ();
- }
+ show_or_hide_channel_checkboxes ();
/* Set up some defaults if no check boxes are checked */
diff --git a/src/wx/audio_dialog.h b/src/wx/audio_dialog.h
index 38f474afd..70c5f4c50 100644
--- a/src/wx/audio_dialog.h
+++ b/src/wx/audio_dialog.h
@@ -46,6 +46,7 @@ private:
void try_to_load_analysis ();
void analysis_finished ();
void setup_statistics ();
+ void show_or_hide_channel_checkboxes ();
boost::shared_ptr<AudioAnalysis> _analysis;
boost::weak_ptr<Film> _film;