Don't display all possible channel checkboxes while the analysis v2.14.35
authorCarl Hetherington <cth@carlh.net>
Wed, 29 Jul 2020 20:30:38 +0000 (22:30 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 29 Jul 2020 20:38:50 +0000 (20:38 +0000)
is running as clicking the higher ones will cause an assertion
failure.

Cherry-picked from 4b5e05b9845d609524328a88a81011b364e03a8a in
v2.15.x.

src/wx/audio_dialog.cc
src/wx/audio_dialog.h

index f4de9cd1aac5b1ddc82f3738d48ac14fb0d68f72..fadda5951aba1af8097b044814976a3cf7ac6f40 100644 (file)
@@ -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));
        }
 
                _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);
        {
                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));
 }
 
        _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 ()
 {
 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 ();
        _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 */
 
 
        /* Set up some defaults if no check boxes are checked */
 
index 38f474afda0200de1f9f7385a7f1a5694d3bf063..70c5f4c50f1d4d29eed8752b5cf803a04df4769e 100644 (file)
@@ -46,6 +46,7 @@ private:
        void try_to_load_analysis ();
        void analysis_finished ();
        void setup_statistics ();
        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;
 
        boost::shared_ptr<AudioAnalysis> _analysis;
        boost::weak_ptr<Film> _film;