From e72546dc3846c9516563d972091c9cf31affd5f5 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 27 Apr 2013 19:05:06 +0100 Subject: [PATCH] Allow multiple selection of content files, and improve behaviour on examining still-image content. --- src/lib/player.cc | 5 +---- src/wx/film_editor.cc | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/lib/player.cc b/src/lib/player.cc index 09f1f55a3..b21224587 100644 --- a/src/lib/player.cc +++ b/src/lib/player.cc @@ -309,10 +309,7 @@ Player::content_changed (weak_ptr w, int p) } if (p == VideoContentProperty::VIDEO_LENGTH) { - if (dynamic_pointer_cast (c)) { - /* FFmpeg content length changes are serious; we need new decoders */ - _have_valid_decoders = false; - } + _have_valid_decoders = false; } } diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index f909a8e2e..b6be39e9b 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -1298,7 +1298,7 @@ FilmEditor::setup_content () void FilmEditor::content_add_clicked (wxCommandEvent &) { - wxFileDialog* d = new wxFileDialog (this); + wxFileDialog* d = new wxFileDialog (this, _("Choose a file or files"), wxT (""), wxT (""), wxT ("*.*"), wxFD_MULTIPLE); int const r = d->ShowModal (); d->Destroy (); @@ -1306,16 +1306,20 @@ FilmEditor::content_add_clicked (wxCommandEvent &) return; } - boost::filesystem::path p (wx_to_std (d->GetPath())); + wxArrayString paths; + d->GetPaths (paths); - if (ImageMagickContent::valid_file (p)) { - _film->add_content (shared_ptr (new ImageMagickContent (p))); - } else if (SndfileContent::valid_file (p)) { - _film->add_content (shared_ptr (new SndfileContent (p))); - } else { - _film->add_content (shared_ptr (new FFmpegContent (p))); + for (unsigned int i = 0; i < paths.GetCount(); ++i) { + boost::filesystem::path p (wx_to_std (paths[i])); + + if (ImageMagickContent::valid_file (p)) { + _film->add_content (shared_ptr (new ImageMagickContent (p))); + } else if (SndfileContent::valid_file (p)) { + _film->add_content (shared_ptr (new SndfileContent (p))); + } else { + _film->add_content (shared_ptr (new FFmpegContent (p))); + } } - } void -- 2.30.2