Allow multiple selection of content files, and improve behaviour on examining still...
authorCarl Hetherington <cth@carlh.net>
Sat, 27 Apr 2013 18:05:06 +0000 (19:05 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 27 Apr 2013 18:05:06 +0000 (19:05 +0100)
src/lib/player.cc
src/wx/film_editor.cc

index 09f1f55a32cdc3a909448d37642278d59b5961ea..b2122458784fa2bc9251b4baa54e2d06ecd47b89 100644 (file)
@@ -309,10 +309,7 @@ Player::content_changed (weak_ptr<Content> w, int p)
        }
 
        if (p == VideoContentProperty::VIDEO_LENGTH) {
-               if (dynamic_pointer_cast<FFmpegContent> (c)) {
-                       /* FFmpeg content length changes are serious; we need new decoders */
-                       _have_valid_decoders = false;
-               }
+               _have_valid_decoders = false;
        }
 }
 
index f909a8e2e6a7d94ab52c030c8ca3986624d8b2fe..b6be39e9b5d90e3a8bf6afd8007422e6c49c95b5 100644 (file)
@@ -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<ImageMagickContent> (new ImageMagickContent (p)));
-       } else if (SndfileContent::valid_file (p)) {
-               _film->add_content (shared_ptr<SndfileContent> (new SndfileContent (p)));
-       } else {
-               _film->add_content (shared_ptr<FFmpegContent> (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<ImageMagickContent> (new ImageMagickContent (p)));
+               } else if (SndfileContent::valid_file (p)) {
+                       _film->add_content (shared_ptr<SndfileContent> (new SndfileContent (p)));
+               } else {
+                       _film->add_content (shared_ptr<FFmpegContent> (new FFmpegContent (p)));
+               }
        }
-       
 }
 
 void