Various little tweaks.
authorCarl Hetherington <cth@carlh.net>
Tue, 21 May 2013 19:45:06 +0000 (20:45 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 21 May 2013 19:45:06 +0000 (20:45 +0100)
src/lib/playlist.cc
src/wx/ffmpeg_content_dialog.cc
src/wx/timeline.cc

index ad71f87d749bd489d2cb35106d7a353901547d25..fc52abbacf2a88c6ce8f8cfd0390592b6dfa009e 100644 (file)
@@ -137,8 +137,11 @@ Playlist::set_from_xml (shared_ptr<const cxml::Node> node)
                } else if (type == "Sndfile") {
                        content.reset (new SndfileContent (*i));
                }
+
+               _content.push_back (content);
        }
 
+       reconnect ();
        _loop = node->number_child<int> ("Loop");
 }
 
index 06b58c58c1d9be97257ac46c0f994901e800e71b..2731782ca50e55db1e3a03079dd262f349fbd8ea 100644 (file)
@@ -40,7 +40,7 @@ FFmpegContentDialog::FFmpegContentDialog (wxWindow* parent, shared_ptr<FFmpegCon
        wxFlexGridSizer* grid = new wxFlexGridSizer (3, 6, 6);
        grid->AddGrowableCol (1, 1);
 
-       add_label_to_sizer (grid, this, _("Audio Stream"));
+       add_label_to_sizer (grid, this, _("Audio stream"));
        _audio_stream = new wxChoice (this, wxID_ANY);
        grid->Add (_audio_stream, 1, wxEXPAND | wxALL, 6);
        _audio_description = new wxStaticText (this, wxID_ANY, wxT (""));
@@ -52,9 +52,9 @@ FFmpegContentDialog::FFmpegContentDialog (wxWindow* parent, shared_ptr<FFmpegCon
        grid->AddSpacer (0);
 
        _audio_stream->Clear ();
-       vector<FFmpegAudioStream> a = content->audio_streams ();
-       for (vector<FFmpegAudioStream>::iterator i = a.begin(); i != a.end(); ++i) {
-               _audio_stream->Append (std_to_wx (i->name), new wxStringClientData (std_to_wx (lexical_cast<string> (i->id))));
+       vector<shared_ptr<FFmpegAudioStream> > a = content->audio_streams ();
+       for (vector<shared_ptr<FFmpegAudioStream> >::iterator i = a.begin(); i != a.end(); ++i) {
+               _audio_stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx (lexical_cast<string> ((*i)->id))));
        }
        
        if (content->audio_stream()) {
@@ -62,12 +62,12 @@ FFmpegContentDialog::FFmpegContentDialog (wxWindow* parent, shared_ptr<FFmpegCon
        }
 
        _subtitle_stream->Clear ();
-       vector<FFmpegSubtitleStream> s = content->subtitle_streams ();
+       vector<shared_ptr<FFmpegSubtitleStream> > s = content->subtitle_streams ();
        if (s.empty ()) {
                _subtitle_stream->Enable (false);
        }
-       for (vector<FFmpegSubtitleStream>::iterator i = s.begin(); i != s.end(); ++i) {
-               _subtitle_stream->Append (std_to_wx (i->name), new wxStringClientData (std_to_wx (lexical_cast<string> (i->id))));
+       for (vector<shared_ptr<FFmpegSubtitleStream> >::iterator i = s.begin(); i != s.end(); ++i) {
+               _subtitle_stream->Append (std_to_wx ((*i)->name), new wxStringClientData (std_to_wx (lexical_cast<string> ((*i)->id))));
        }
        
        if (content->subtitle_stream()) {
@@ -106,10 +106,10 @@ FFmpegContentDialog::audio_stream_changed (wxCommandEvent &)
                return;
        }
        
-       vector<FFmpegAudioStream> a = c->audio_streams ();
-       vector<FFmpegAudioStream>::iterator i = a.begin ();
+       vector<shared_ptr<FFmpegAudioStream> > a = c->audio_streams ();
+       vector<shared_ptr<FFmpegAudioStream> >::iterator i = a.begin ();
        string const s = string_client_data (_audio_stream->GetClientObject (_audio_stream->GetSelection ()));
-       while (i != a.end() && lexical_cast<string> (i->id) != s) {
+       while (i != a.end() && lexical_cast<string> ((*i)->id) != s) {
                ++i;
        }
 
@@ -141,10 +141,10 @@ FFmpegContentDialog::subtitle_stream_changed (wxCommandEvent &)
                return;
        }
        
-       vector<FFmpegSubtitleStream> a = c->subtitle_streams ();
-       vector<FFmpegSubtitleStream>::iterator i = a.begin ();
+       vector<shared_ptr<FFmpegSubtitleStream> > a = c->subtitle_streams ();
+       vector<shared_ptr<FFmpegSubtitleStream> >::iterator i = a.begin ();
        string const s = string_client_data (_subtitle_stream->GetClientObject (_subtitle_stream->GetSelection ()));
-       while (i != a.end() && lexical_cast<string> (i->id) != s) {
+       while (i != a.end() && lexical_cast<string> ((*i)->id) != s) {
                ++i;
        }
 
@@ -162,7 +162,6 @@ FFmpegContentDialog::audio_mapping_changed (AudioMapping m)
                return;
        }
 
-       cout << "setting map in stream " << content->audio_stream().get() << "\n";
        content->audio_stream()->mapping = m;
 }
 
index 3a833e701de09a6e4efc44214976f2ac7283ef2d..56a40378ea3ef60254f80df98dac25a0313501de 100644 (file)
@@ -328,7 +328,8 @@ Timeline::playlist_changed ()
        for (Playlist::ContentList::iterator i = content.begin(); i != content.end(); ++i) {
                if (dynamic_pointer_cast<VideoContent> (*i)) {
                        _views.push_back (shared_ptr<View> (new VideoContentView (*this, *i, 0)));
-               } else {
+               }
+               if (dynamic_pointer_cast<AudioContent> (*i)) {
                        _views.push_back (shared_ptr<View> (new AudioContentView (*this, *i, 1)));
                }
        }