Fix last-but-one commit.
[dcpomatic.git] / src / wx / audio_panel.cc
index 7a7b4674cab0de3599ac9c4b689ebf09a62f9e67..2a41aeb2def0543b497bd3879d2ee643af24f90f 100644 (file)
@@ -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"
 #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