From 4e4b758bb59cde29fcd85ed1a59a42a32536f230 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 26 Jul 2013 15:55:03 +0100 Subject: Set up audio stream description on load. --- src/wx/audio_panel.cc | 23 +++++++++++++++++++++++ src/wx/audio_panel.h | 1 + 2 files changed, 24 insertions(+) (limited to 'src') 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 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 c, int property) if (fc->audio_stream()) { checked_set (_stream, lexical_cast (fc->audio_stream()->id)); + setup_stream_description (); } } } @@ -225,6 +228,10 @@ AudioPanel::stream_changed () if (!fc) { return; } + + if (_stream->GetSelection() == -1) { + return; + } vector > a = fc->audio_streams (); vector >::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 c = _editor->selected_content (); + if (!c) { + return; + } + + shared_ptr fc = dynamic_pointer_cast (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; -- cgit v1.2.3