From 2cf3da72a017eebf741dfb9a5ec158df94a4e7b7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 9 Jul 2014 09:36:58 +0100 Subject: Basics of DCP import. --- src/wx/film_editor.cc | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src/wx') diff --git a/src/wx/film_editor.cc b/src/wx/film_editor.cc index 5b4f6e8fe..ad7451cb9 100644 --- a/src/wx/film_editor.cc +++ b/src/wx/film_editor.cc @@ -45,6 +45,7 @@ #include "lib/playlist.h" #include "lib/content.h" #include "lib/content_factory.h" +#include "lib/dcp_content.h" #include "timecode.h" #include "wx_util.h" #include "film_editor.h" @@ -836,16 +837,22 @@ FilmEditor::content_add_folder_clicked () return; } - shared_ptr ic; + shared_ptr content; try { - ic.reset (new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))); - } catch (FileError& e) { - error_dialog (this, std_to_wx (e.what ())); - return; + content.reset (new ImageContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))); + } catch (...) { + try { + content.reset (new DCPContent (_film, boost::filesystem::path (wx_to_std (d->GetPath ())))); + } catch (...) { + error_dialog (this, _("Could not find any images nor a DCP in that folder")); + return; + } } - _film->examine_and_add_content (ic); + if (content) { + _film->examine_and_add_content (content); + } } void -- cgit v1.2.3