diff options
| author | Carl Hetherington <cth@carlh.net> | 2022-03-19 22:34:00 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2022-03-19 22:34:23 +0100 |
| commit | 7bc591abc86ed4742f21f45ca1d6151cb14bc100 (patch) | |
| tree | 661f3e1c78e80be366f0caad720f10e835a9f573 /src/lib | |
| parent | c7d1f6e7988888811fdac36c465919f170a06c7a (diff) | |
Add config option for default KDM type.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 5 | ||||
| -rw-r--r-- | src/lib/config.h | 10 |
2 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index b66154038..6e654d5be 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2022 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -182,6 +182,7 @@ Config::set_defaults () _use_isdcf_name_by_default = true; _write_kdms_to_disk = true; _email_kdms = false; + _default_kdm_type = dcp::Formulation::MODIFIED_TRANSITIONAL_1; _allowed_dcp_frame_rates.clear (); _allowed_dcp_frame_rates.push_back (24); @@ -571,6 +572,7 @@ try _use_isdcf_name_by_default = f.optional_bool_child("UseISDCFNameByDefault").get_value_or(true); _write_kdms_to_disk = f.optional_bool_child("WriteKDMsToDisk").get_value_or(true); _email_kdms = f.optional_bool_child("EmailKDMs").get_value_or(false); + _default_kdm_type = dcp::string_to_formulation(f.optional_string_child("DefaultKDMType").get_value_or("modified-transitional-1")); if (boost::filesystem::exists (_cinemas_file)) { cxml::Document f ("Cinemas"); @@ -1003,6 +1005,7 @@ Config::write_config () const root->add_child("UseISDCFNameByDefault")->add_child_text(_use_isdcf_name_by_default ? "1" : "0"); root->add_child("WriteKDMsToDisk")->add_child_text(_write_kdms_to_disk ? "1" : "0"); root->add_child("EmailKDMs")->add_child_text(_email_kdms ? "1" : "0"); + root->add_child("DefaultKDMType")->add_child_text(dcp::formulation_to_string(_default_kdm_type)); auto target = config_write_file(); diff --git a/src/lib/config.h b/src/lib/config.h index ec152b969..2ad201c35 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -563,6 +563,11 @@ public: return _email_kdms; } + dcp::Formulation default_kdm_type () const { + return _default_kdm_type; + } + + /* SET (mostly) */ void set_master_encoding_threads (int n) { @@ -1079,6 +1084,10 @@ public: maybe_set (_email_kdms, email); } + void set_default_kdm_type (dcp::Formulation type) { + maybe_set (_default_kdm_type, type); + } + void changed (Property p = OTHER); boost::signals2::signal<void (Property)> Changed; /** Emitted if read() failed on an existing Config file. There is nothing @@ -1297,6 +1306,7 @@ private: bool _use_isdcf_name_by_default; bool _write_kdms_to_disk; bool _email_kdms; + dcp::Formulation _default_kdm_type; static int const _current_version; |
