From: Carl Hetherington Date: Wed, 26 Jan 2022 23:03:17 +0000 (+0100) Subject: Add option to use (or not) ISDCF names by default. X-Git-Tag: v2.16.6~14 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=450602739388811a6378314d6c309b99f7b28b60 Add option to use (or not) ISDCF names by default. --- 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 Changed; /** Emitted if read() failed on an existing Config file. There is nothing @@ -1267,6 +1275,7 @@ private: boost::optional _audio_mapping; std::vector _custom_languages; boost::optional _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 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) diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index eba81507c..3fef8ef8b 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -334,12 +334,16 @@ private: table->Add (_kdm_directory, 1, wxEXPAND); + table->Add (_use_isdcf_name_by_default = new CheckBox(_panel, _("Use ISDCF name by default")), 0, wxALIGN_CENTRE_VERTICAL); + _still_length->SetRange (1, 3600); _still_length->Bind (wxEVT_SPINCTRL, boost::bind (&DefaultsPage::still_length_changed, this)); _directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::directory_changed, this)); _kdm_directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::kdm_directory_changed, this)); + _use_isdcf_name_by_default->Bind (wxEVT_CHECKBOX, boost::bind(&DefaultsPage::use_isdcf_name_by_default_changed, this)); + for (auto i: Ratio::containers()) { _container->Append (std_to_wx(i->container_nickname())); } @@ -395,6 +399,7 @@ private: checked_set (_still_length, config->default_still_length ()); _directory->SetPath (std_to_wx (config->default_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())).string ())); _kdm_directory->SetPath (std_to_wx (config->default_kdm_directory_or (wx_to_std (wxStandardPaths::Get().GetDocumentsDir())).string ())); + checked_set (_use_isdcf_name_by_default, config->use_isdcf_name_by_default()); checked_set (_j2k_bandwidth, config->default_j2k_bandwidth() / 1000000); _j2k_bandwidth->SetRange (50, config->maximum_j2k_bandwidth() / 1000000); checked_set (_dcp_audio_channels, locale_convert (config->default_dcp_audio_channels())); @@ -453,6 +458,11 @@ private: Config::instance()->set_default_kdm_directory (wx_to_std (_kdm_directory->GetPath ())); } + void use_isdcf_name_by_default_changed () + { + Config::instance()->set_use_isdcf_name_by_default (_use_isdcf_name_by_default->GetValue()); + } + void still_length_changed () { Config::instance()->set_default_still_length (_still_length->GetValue ()); @@ -504,6 +514,7 @@ private: wxDirPickerCtrl* _directory; wxDirPickerCtrl* _kdm_directory; #endif + wxCheckBox* _use_isdcf_name_by_default; wxChoice* _container; wxChoice* _dcp_content_type; wxChoice* _dcp_audio_channels; diff --git a/test/data b/test/data index 6e8b53393..551b4ea59 160000 --- a/test/data +++ b/test/data @@ -1 +1 @@ -Subproject commit 6e8b533930445626c7f92bc9a11d2ab36e0546c5 +Subproject commit 551b4ea593022d046770b9efcc19c2b0ec9604f5