diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-04-11 21:01:46 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-04-11 21:01:46 +0100 |
| commit | 9b7df719c56b956e8a2aed336677550b64780c5a (patch) | |
| tree | 2318f3f78e02a678c79a2e266ec89eeed6e647e9 /src | |
| parent | 164bf3eaae49f654d609c747850b3f564fa20102 (diff) | |
Fix audio display to only offer available channels.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/audio_dialog.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/wx/audio_dialog.cc b/src/wx/audio_dialog.cc index bfd92f0b6..bed7aac6d 100644 --- a/src/wx/audio_dialog.cc +++ b/src/wx/audio_dialog.cc @@ -43,7 +43,6 @@ AudioDialog::AudioDialog (wxWindow* parent) wxStaticText* m = new wxStaticText (this, wxID_ANY, _("Channels")); side->Add (m, 1, wxALIGN_CENTER_VERTICAL | wxTOP, 16); } - for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { _channel_checkbox[i] = new wxCheckBox (this, wxID_ANY, std_to_wx (audio_channel_name (i))); @@ -91,6 +90,10 @@ AudioDialog::set_film (shared_ptr<Film> f) _film = f; + for (int i = 0; i < MAX_AUDIO_CHANNELS; ++i) { + _channel_checkbox[i]->Show (!_film->audio_mapping().dcp_to_content (static_cast<libdcp::Channel> (i)).empty()); + } + try_to_load_analysis (); _plot->set_gain (_film->audio_gain ()); @@ -116,7 +119,9 @@ AudioDialog::try_to_load_analysis () _plot->set_analysis (a); - _channel_checkbox[0]->SetValue (true); + if (_channel_checkbox[0]) { + _channel_checkbox[0]->SetValue (true); + } _plot->set_channel_visible (0, true); for (int i = 0; i < AudioPoint::COUNT; ++i) { |
