diff options
Diffstat (limited to 'src/wx/audio_panel.cc')
| -rw-r--r-- | src/wx/audio_panel.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/wx/audio_panel.cc b/src/wx/audio_panel.cc index 7a7b4674c..2a41aeb2d 100644 --- a/src/wx/audio_panel.cc +++ b/src/wx/audio_panel.cc @@ -17,8 +17,6 @@ */ -#include <boost/lexical_cast.hpp> -#include <wx/spinctrl.h> #include "lib/config.h" #include "lib/ffmpeg_content.h" #include "lib/ffmpeg_audio_stream.h" @@ -30,11 +28,15 @@ #include "wx_util.h" #include "gain_calculator_dialog.h" #include "content_panel.h" +#include <wx/spinctrl.h> +#include <boost/lexical_cast.hpp> +#include <boost/foreach.hpp> using std::vector; using std::cout; using std::string; using std::list; +using std::pair; using boost::dynamic_pointer_cast; using boost::lexical_cast; using boost::shared_ptr; @@ -154,16 +156,18 @@ AudioPanel::film_content_changed (int property) _mapping->set (acs ? acs->audio_mapping () : AudioMapping ()); _sizer->Layout (); } else if (property == FFmpegContentProperty::AUDIO_STREAMS) { - _stream->Clear (); if (fcs) { - vector<shared_ptr<FFmpegAudioStream> > a = fcs->audio_streams (); - for (vector<shared_ptr<FFmpegAudioStream> >::iterator i = a.begin(); i != a.end(); ++i) { - _stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx ((*i)->identifier ()))); + vector<pair<string, string> > data; + BOOST_FOREACH (shared_ptr<FFmpegAudioStream> i, fcs->audio_streams ()) { + data.push_back (make_pair (i->name, i->identifier ())); } + checked_set (_stream, data); if (fcs->audio_stream()) { checked_set (_stream, fcs->audio_stream()->identifier ()); } + } else { + _stream->Clear (); } } else if (property == AudioContentProperty::AUDIO_PROCESSOR) { if (acs) { @@ -264,11 +268,11 @@ AudioPanel::setup_description () { AudioContentList ac = _parent->selected_audio (); if (ac.size () != 1) { - _description->SetLabel (""); + checked_set (_description, wxT ("")); return; } - _description->SetLabel (std_to_wx (ac.front()->processing_description ())); + checked_set (_description, ac.front()->processing_description ()); } void |
