diff options
| author | Carl Hetherington <cth@carlh.net> | 2016-08-27 20:28:18 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2016-08-27 20:28:18 +0100 |
| commit | 65a73ce59aeb4b452f55a87c001acb3cf177e99f (patch) | |
| tree | 3421211f5573f877e14d3b090e762abf49629fc0 /src/lib | |
| parent | c0d2b454ea1e8c9b047907343c902d72101ef6dd (diff) | |
| parent | 9ce33a007d305cec0ebb91dc4839d0d2a05837ab (diff) | |
Merge branch 'master' of ssh://git.carlh.net/home/carl/git/dcpomatic
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 7 | ||||
| -rw-r--r-- | src/lib/config.h | 9 | ||||
| -rw-r--r-- | src/lib/dcp_decoder.cc | 8 |
3 files changed, 23 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 1d9cce64e..a009edda8 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -111,6 +111,7 @@ Config::set_defaults () #endif _cinemas_file = path ("cinemas.xml"); _show_hints_before_make_dcp = true; + _confirm_kdm_email = true; _kdm_filename_format = dcp::NameFormat ("KDM %f %c %s"); _dcp_metadata_filename_format = dcp::NameFormat ("%t"); _dcp_asset_filename_format = dcp::NameFormat ("%t"); @@ -296,6 +297,7 @@ try _cinemas_file = f.optional_string_child("CinemasFile").get_value_or (path ("cinemas.xml").string ()); _show_hints_before_make_dcp = f.optional_bool_child("ShowHintsBeforeMakeDCP").get_value_or (true); + _confirm_kdm_email = f.optional_bool_child("ConfirmKDMEmail").get_value_or (true); _kdm_filename_format = dcp::NameFormat (f.optional_string_child("KDMFilenameFormat").get_value_or ("KDM %f %c %s")); _dcp_metadata_filename_format = dcp::NameFormat (f.optional_string_child("DCPMetadataFilenameFormat").get_value_or ("%t")); _dcp_asset_filename_format = dcp::NameFormat (f.optional_string_child("DCPAssetFilenameFormat").get_value_or ("%t")); @@ -456,6 +458,7 @@ Config::write_config_xml () const root->add_child("CinemasFile")->add_child_text (_cinemas_file.string()); root->add_child("ShowHintsBeforeMakeDCP")->add_child_text (_show_hints_before_make_dcp ? "1" : "0"); + root->add_child("ConfirmKDMEmail")->add_child_text (_confirm_kdm_email ? "1" : "0"); root->add_child("KDMFilenameFormat")->add_child_text (_kdm_filename_format.specification ()); root->add_child("DCPMetadataFilenameFormat")->add_child_text (_dcp_metadata_filename_format.specification ()); root->add_child("DCPAssetFilenameFormat")->add_child_text (_dcp_asset_filename_format.specification ()); @@ -599,6 +602,10 @@ Config::save_template (shared_ptr<const Film> film, string name) const list<string> Config::templates () const { + if (!boost::filesystem::exists (path ("templates"))) { + return list<string> (); + } + list<string> n; for (boost::filesystem::directory_iterator i (path("templates")); i != boost::filesystem::directory_iterator(); ++i) { n.push_back (i->path().filename().string()); diff --git a/src/lib/config.h b/src/lib/config.h index e18cd3312..a38fb129c 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -268,6 +268,10 @@ public: return _show_hints_before_make_dcp; } + bool confirm_kdm_email () const { + return _confirm_kdm_email; + } + dcp::NameFormat kdm_filename_format () const { return _kdm_filename_format; } @@ -487,6 +491,10 @@ public: maybe_set (_show_hints_before_make_dcp, s); } + void set_confirm_kdm_email (bool s) { + maybe_set (_confirm_kdm_email, s); + } + void set_kdm_filename_format (dcp::NameFormat n) { maybe_set (_kdm_filename_format, n); } @@ -617,6 +625,7 @@ private: std::vector<dcp::EncryptedKDM> _dkdms; boost::filesystem::path _cinemas_file; bool _show_hints_before_make_dcp; + bool _confirm_kdm_email; dcp::NameFormat _kdm_filename_format; dcp::NameFormat _dcp_metadata_filename_format; dcp::NameFormat _dcp_asset_filename_format; diff --git a/src/lib/dcp_decoder.cc b/src/lib/dcp_decoder.cc index 2e3ed374a..156fba101 100644 --- a/src/lib/dcp_decoder.cc +++ b/src/lib/dcp_decoder.cc @@ -73,7 +73,13 @@ DCPDecoder::DCPDecoder (shared_ptr<const DCPContent> c, shared_ptr<Log> log) } } - DCPOMATIC_ASSERT (cpl); + if (!cpl) { + /* No CPL found; probably an old file that doesn't specify it; + just use the first one. + */ + cpl = cpls().front (); + } + _reels = cpl->reels (); _reel = _reels.begin (); |
