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-01-27 00:03:17 +0100
commitb210e46788f6cd368657dbef602cf91e12adc99a (patch)
treeedfded8651adbf9b5892d6b3f99da7a78b1bdead /src/lib
parent29196ecc58f92432c21bac47dc5a59c6408524b4 (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 f8639692f..7311189ad 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -185,6 +185,7 @@ Config::set_defaults ()
_custom_languages.clear ();
_add_files_path = boost::none;
_auto_crop_threshold = 0.1;
+ _use_isdcf_name_by_default = true;
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
@@ -586,6 +587,7 @@ try
_add_files_path = f.optional_string_child("AddFilesPath");
_auto_crop_threshold = f.optional_number_child<double>("AutoCropThreshold").get_value_or(0.1);
+ _use_isdcf_name_by_default = f.optional_bool_child("UseISDCFNameByDefault").get_value_or(true);
if (boost::filesystem::exists (_cinemas_file)) {
cxml::Document f ("Cinemas");
@@ -1018,6 +1020,7 @@ Config::write_config () const
root->add_child("AddFilesPath")->add_child_text(_add_files_path->string());
}
root->add_child("AutoCropThreshold")->add_child_text(raw_convert<string>(_auto_crop_threshold));
+ 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 956d8aa9b..177fffc37 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -556,6 +556,10 @@ public:
return _auto_crop_threshold;
}
+ bool use_isdcf_name_by_default () const {
+ return _use_isdcf_name_by_default;
+ }
+
/* SET (mostly) */
void set_master_encoding_threads (int n) {
@@ -1068,6 +1072,10 @@ public:
maybe_set (_auto_crop_threshold, threshold, AUTO_CROP_THRESHOLD);
}
+ 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
@@ -1282,6 +1290,7 @@ private:
std::vector<dcp::LanguageTag> _custom_languages;
boost::optional<boost::filesystem::path> _add_files_path;
double _auto_crop_threshold;
+ bool _use_isdcf_name_by_default;
static int const _current_version;
diff --git a/src/lib/film.cc b/src/lib/film.cc
index 57aa7a146..e9b4675be 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)