summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-01-27 00:03:17 +0100
committerCarl Hetherington <cth@carlh.net>2022-03-09 17:04:02 +0100
commit450602739388811a6378314d6c309b99f7b28b60 (patch)
treecdf2860abf7e2c447154fba0305178fdba70dbfe /src/lib
parent701c510562bfa4fffcd21f94f0714405ca508a37 (diff)
Add option to use (or not) ISDCF names by default.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc3
-rw-r--r--src/lib/config.h9
-rw-r--r--src/lib/film.cc2
3 files changed, 13 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 9b369a81f..0de19f70f 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -179,6 +179,7 @@ Config::set_defaults ()
_audio_mapping = boost::none;
_custom_languages.clear ();
_add_files_path = boost::none;
+ _use_isdcf_name_by_default = true;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
@@ -565,6 +566,7 @@ try
}
_add_files_path = f.optional_string_child("AddFilesPath");
+ _use_isdcf_name_by_default = f.optional_bool_child("UseISDCFNameByDefault").get_value_or(true);
if (boost::filesystem::exists (_cinemas_file)) {
cxml::Document f ("Cinemas");
@@ -994,6 +996,7 @@ Config::write_config () const
/* [XML] AddFilesPath The default path that will be offered in the picker when adding files to a film. */
root->add_child("AddFilesPath")->add_child_text(_add_files_path->string());
}
+ root->add_child("UseISDCFNameByDefault")->add_child_text(_use_isdcf_name_by_default ? "1" : "0");
auto target = config_write_file();
diff --git a/src/lib/config.h b/src/lib/config.h
index 39704fde1..32f9c738f 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -548,6 +548,10 @@ public:
return _add_files_path;
}
+ bool use_isdcf_name_by_default () const {
+ return _use_isdcf_name_by_default;
+ }
+
/* SET (mostly) */
void set_master_encoding_threads (int n) {
@@ -1052,6 +1056,10 @@ public:
changed ();
}
+ void set_use_isdcf_name_by_default (bool use) {
+ maybe_set (_use_isdcf_name_by_default, use);
+ }
+
void changed (Property p = OTHER);
boost::signals2::signal<void (Property)> Changed;
/** Emitted if read() failed on an existing Config file. There is nothing
@@ -1267,6 +1275,7 @@ private:
boost::optional<AudioMapping> _audio_mapping;
std::vector<dcp::LanguageTag> _custom_languages;
boost::optional<boost::filesystem::path> _add_files_path;
+ bool _use_isdcf_name_by_default;
static int const _current_version;
diff --git a/src/lib/film.cc b/src/lib/film.cc
index d0f0106c4..5e99e466c 100644
--- a/src/lib/film.cc
+++ b/src/lib/film.cc
@@ -155,7 +155,7 @@ int const Film::current_state_version = 38;
Film::Film (optional<boost::filesystem::path> dir)
: _playlist (new Playlist)
- , _use_isdcf_name (true)
+ , _use_isdcf_name (Config::instance()->use_isdcf_name_by_default())
, _dcp_content_type (Config::instance()->default_dcp_content_type ())
, _container (Config::instance()->default_container ())
, _resolution (Resolution::TWO_K)