diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-07-01 18:04:14 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-07-01 18:04:14 +0100 |
| commit | 92b6430402753a572c33d594ba0745a4e461edf4 (patch) | |
| tree | d9bd040ee243cfe0e1730fc2df18d97adc7f2e8e /src/wx/audio_panel.cc | |
| parent | c5b9ad09ab5eaf032b0816f619ab5d75254e8597 (diff) | |
Re-add show audio button and analyse just that content when it is clicked.
Diffstat (limited to 'src/wx/audio_panel.cc')
| -rw-r--r-- | src/wx/audio_panel.cc | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index c31d5b575..46d7a2254 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -25,6 +25,7 @@ #include "wx_util.h" #include "gain_calculator_dialog.h" #include "content_panel.h" +#include "audio_dialog.h" #include <wx/spinctrl.h> #include <boost/lexical_cast.hpp> #include <boost/foreach.hpp> @@ -40,12 +41,17 @@ using boost::shared_ptr; AudioPanel::AudioPanel (ContentPanel* p) : ContentSubPanel (p, _("Audio")) + , _audio_dialog (0) { wxGridBagSizer* grid = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP); _sizer->Add (grid, 0, wxALL, 8); int r = 0; + _show = new wxButton (this, wxID_ANY, _("Show Audio...")); + grid->Add (_show, wxGBPosition (r, 0)); + ++r; + add_label_to_grid_bag_sizer (grid, this, _("Gain"), true, wxGBPosition (r, 0)); _gain = new ContentSpinCtrlDouble<AudioContent> ( this, @@ -92,11 +98,19 @@ AudioPanel::AudioPanel (ContentPanel* p) _gain->wrapped()->SetIncrement (0.5); _delay->wrapped()->SetRange (-1000, 1000); - _gain_calculate_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&AudioPanel::gain_calculate_button_clicked, this)); + _show->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&AudioPanel::show_clicked, this)); + _gain_calculate_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&AudioPanel::gain_calculate_button_clicked, this)); _mapping_connection = _mapping->Changed.connect (boost::bind (&AudioPanel::mapping_changed, this, _1)); } +AudioPanel::~AudioPanel () +{ + if (_audio_dialog) { + _audio_dialog->Destroy (); + _audio_dialog = 0; + } +} void AudioPanel::film_changed (Film::Property property) @@ -190,3 +204,20 @@ AudioPanel::content_selection_changed () film_content_changed (AudioContentProperty::AUDIO_STREAMS); } + +void +AudioPanel::show_clicked () +{ + if (_audio_dialog) { + _audio_dialog->Destroy (); + _audio_dialog = 0; + } + + AudioContentList ac = _parent->selected_audio (); + if (ac.size() != 1) { + return; + } + + _audio_dialog = new AudioDialog (this, _parent->film (), ac.front ()); + _audio_dialog->Show (); +} |
