diff options
| author | Carl Hetherington <cth@carlh.net> | 2013-07-26 15:55:03 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2013-07-26 15:55:03 +0100 |
| commit | 4e4b758bb59cde29fcd85ed1a59a42a32536f230 (patch) | |
| tree | c6783a4f33704d8d6606af797debdb260dae5d43 /src | |
| parent | 424f70766c4acc8519633dd72f0d31dd93798bfb (diff) | |
Set up audio stream description on load.
Diffstat (limited to 'src')
| -rw-r--r-- | src/wx/audio_panel.cc | 23 | ||||
| -rw-r--r-- | src/wx/audio_panel.h | 1 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index 4fbb72708..f8dba6cd4 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -127,6 +127,8 @@ AudioPanel::film_content_changed (shared_ptr<Content> c, int property) } else if (property == AudioContentProperty::AUDIO_MAPPING) { _mapping->set (ac ? ac->audio_mapping () : AudioMapping ()); _sizer->Layout (); + } else if (property == FFmpegContentProperty::AUDIO_STREAM) { + setup_stream_description (); } else if (property == FFmpegContentProperty::AUDIO_STREAMS) { _stream->Clear (); if (fc) { @@ -137,6 +139,7 @@ AudioPanel::film_content_changed (shared_ptr<Content> c, int property) if (fc->audio_stream()) { checked_set (_stream, lexical_cast<string> (fc->audio_stream()->id)); + setup_stream_description (); } } } @@ -225,6 +228,10 @@ AudioPanel::stream_changed () if (!fc) { return; } + + if (_stream->GetSelection() == -1) { + return; + } vector<shared_ptr<FFmpegAudioStream> > a = fc->audio_streams (); vector<shared_ptr<FFmpegAudioStream> >::iterator i = a.begin (); @@ -237,6 +244,22 @@ AudioPanel::stream_changed () fc->set_audio_stream (*i); } + setup_stream_description (); +} + +void +AudioPanel::setup_stream_description () +{ + shared_ptr<Content> c = _editor->selected_content (); + if (!c) { + return; + } + + shared_ptr<FFmpegContent> fc = dynamic_pointer_cast<FFmpegContent> (c); + if (!fc) { + return; + } + if (!fc->audio_stream ()) { _description->SetLabel (wxT ("")); } else { diff --git a/src/wx/audio_panel.h b/src/wx/audio_panel.h index fb2d92966..9c0d2a877 100644 --- a/src/wx/audio_panel.h +++ b/src/wx/audio_panel.h @@ -41,6 +41,7 @@ private: void delay_changed (); void stream_changed (); void mapping_changed (AudioMapping); + void setup_stream_description (); wxSpinCtrl* _gain; wxButton* _gain_calculate_button; |
