summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-03-19 22:34:00 +0100
committerCarl Hetherington <cth@carlh.net>2022-03-19 22:34:23 +0100
commit7bc591abc86ed4742f21f45ca1d6151cb14bc100 (patch)
tree661f3e1c78e80be366f0caad720f10e835a9f573
parentc7d1f6e7988888811fdac36c465919f170a06c7a (diff)
Add config option for default KDM type.
-rw-r--r--cscript4
-rw-r--r--src/lib/config.cc5
-rw-r--r--src/lib/config.h10
-rw-r--r--src/wx/full_config_dialog.cc14
-rw-r--r--src/wx/kdm_choice.cc24
-rw-r--r--src/wx/kdm_choice.h4
-rw-r--r--src/wx/kdm_output_panel.cc2
7 files changed, 57 insertions, 6 deletions
diff --git a/cscript b/cscript
index 06bf0eb51..25208d1a2 100644
--- a/cscript
+++ b/cscript
@@ -402,8 +402,8 @@ def dependencies(target, options):
# Use distro-provided FFmpeg on Arch
deps = []
- deps.append(('libdcp', 'v1.8.10'))
- deps.append(('libsub', 'v1.6.10'))
+ deps.append(('libdcp', 'v1.8.11'))
+ deps.append(('libsub', 'v1.6.11'))
deps.append(('leqm-nrt', '93ae9e6'))
deps.append(('rtaudio', 'f619b76'))
# We get our OpenSSL libraries from the environment, but we
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;
diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc
index 3fef8ef8b..127ca4129 100644
--- a/src/wx/full_config_dialog.cc
+++ b/src/wx/full_config_dialog.cc
@@ -34,6 +34,7 @@
#include "file_picker_ctrl.h"
#include "filter_dialog.h"
#include "full_config_dialog.h"
+#include "kdm_choice.h"
#include "make_chain_dialog.h"
#include "nag_dialog.h"
#include "name_format_editor.h"
@@ -331,9 +332,12 @@ private:
#else
_kdm_directory = new wxDirPickerCtrl (_panel, wxDD_DIR_MUST_EXIST);
#endif
-
table->Add (_kdm_directory, 1, wxEXPAND);
+ add_label_to_sizer (table, _panel, _("Default KDM type"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
+ _kdm_type = new KDMChoice (_panel);
+ table->Add (_kdm_type, 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);
@@ -341,6 +345,7 @@ private:
_directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::directory_changed, this));
_kdm_directory->Bind (wxEVT_DIRPICKER_CHANGED, boost::bind (&DefaultsPage::kdm_directory_changed, this));
+ _kdm_type->Bind (wxEVT_CHOICE, boost::bind(&DefaultsPage::kdm_type_changed, this));
_use_isdcf_name_by_default->Bind (wxEVT_CHECKBOX, boost::bind(&DefaultsPage::use_isdcf_name_by_default_changed, this));
@@ -399,6 +404,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 ()));
+ _kdm_type->set (config->default_kdm_type());
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);
@@ -458,6 +464,11 @@ private:
Config::instance()->set_default_kdm_directory (wx_to_std (_kdm_directory->GetPath ()));
}
+ void kdm_type_changed ()
+ {
+ Config::instance()->set_default_kdm_type(_kdm_type->get());
+ }
+
void use_isdcf_name_by_default_changed ()
{
Config::instance()->set_use_isdcf_name_by_default (_use_isdcf_name_by_default->GetValue());
@@ -514,6 +525,7 @@ private:
wxDirPickerCtrl* _directory;
wxDirPickerCtrl* _kdm_directory;
#endif
+ KDMChoice* _kdm_type;
wxCheckBox* _use_isdcf_name_by_default;
wxChoice* _container;
wxChoice* _dcp_content_type;
diff --git a/src/wx/kdm_choice.cc b/src/wx/kdm_choice.cc
index 64a43f765..c8685e22c 100644
--- a/src/wx/kdm_choice.cc
+++ b/src/wx/kdm_choice.cc
@@ -33,8 +33,30 @@ KDMChoice::KDMChoice (wxWindow* parent)
dcp::Formulation
+KDMChoice::get_formulation (unsigned int n) const
+{
+ return static_cast<dcp::Formulation>(reinterpret_cast<intptr_t>(GetClientData(n)));
+}
+
+
+dcp::Formulation
KDMChoice::get () const
{
- return static_cast<dcp::Formulation>(reinterpret_cast<intptr_t>(GetClientData(GetSelection())));
+ return get_formulation(GetSelection());
+}
+
+
+void
+KDMChoice::set (dcp::Formulation type)
+{
+ for (unsigned int i = 0; i < GetCount(); ++i) {
+ if (get_formulation(i) == type) {
+ SetSelection(i);
+ return;
+ }
+ }
}
+
+
+
diff --git a/src/wx/kdm_choice.h b/src/wx/kdm_choice.h
index 3f2bcdfe0..109c552f0 100644
--- a/src/wx/kdm_choice.h
+++ b/src/wx/kdm_choice.h
@@ -29,5 +29,9 @@ public:
KDMChoice (wxWindow* parent);
dcp::Formulation get () const;
+ void set (dcp::Formulation type);
+
+private:
+ dcp::Formulation get_formulation (unsigned int n) const;
};
diff --git a/src/wx/kdm_output_panel.cc b/src/wx/kdm_output_panel.cc
index ec2182c36..bc66e37b9 100644
--- a/src/wx/kdm_output_panel.cc
+++ b/src/wx/kdm_output_panel.cc
@@ -72,7 +72,7 @@ KDMOutputPanel::KDMOutputPanel (wxWindow* parent)
auto type = new wxBoxSizer (wxHORIZONTAL);
_type = new KDMChoice (this);
type->Add (_type, 1, wxTOP, DCPOMATIC_CHOICE_TOP_PAD);
- _type->SetSelection (0);
+ _type->set(Config::instance()->default_kdm_type());
auto advanced = new Button (this, _("Advanced..."));
type->Add (advanced, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP);
table->Add (type, 1, wxTOP, DCPOMATIC_CHOICE_TOP_PAD);