Remove default DCP content type setting.
authorCarl Hetherington <cth@carlh.net>
Thu, 9 May 2024 19:56:07 +0000 (21:56 +0200)
committerCarl Hetherington <cth@carlh.net>
Wed, 29 May 2024 08:35:55 +0000 (10:35 +0200)
src/lib/config.cc
src/lib/config.h
src/wx/full_config_dialog.cc
test/create_cli_test.cc
test/data
test/test.cc

index 1269206ee09a9fbda71ae1f3c9f0bdf057acbe65..58c4afe102c5452c2f965c4718baabd4fd3440b6 100644 (file)
@@ -770,12 +770,6 @@ Config::write_config () const
                /* [XML:opt] Language Language to use in the GUI e.g. <code>fr_FR</code>. */
                cxml::add_text_child(root, "Language", _language.get());
        }
-       if (_default_dcp_content_type) {
-               /* [XML:opt] DefaultDCPContentType Default content type to use when creating new films (<code>FTR</code>, <code>SHR</code>,
-                  <code>TLR</code>, <code>TST</code>, <code>XSN</code>, <code>RTG</code>, <code>TSR</code>, <code>POL</code>,
-                  <code>PSA</code> or <code>ADV</code>). */
-               cxml::add_text_child(root, "DefaultDCPContentType", _default_dcp_content_type->isdcf_name());
-       }
        /* [XML] DefaultDCPAudioChannels Default number of audio channels to use when creating new films. */
        cxml::add_text_child(root, "DefaultDCPAudioChannels", raw_convert<string>(_default_dcp_audio_channels));
        /* [XML] DCPIssuer Issuer text to write into CPL files. */
index b8dab9a449475e8fb397190f02cbbf767b4af489..ab44e414aaf44627d6e91c3d5cba12dad0b250d7 100644 (file)
@@ -770,10 +770,6 @@ public:
                maybe_set (_default_still_length, s);
        }
 
-       void set_default_dcp_content_type (DCPContentType const * t) {
-               maybe_set (_default_dcp_content_type, t);
-       }
-
        void set_default_dcp_audio_channels (int c) {
                maybe_set (_default_dcp_audio_channels, c);
        }
index 00e5575b180c156ba83b3f344cdcc7ef8b58e3b1..6d54cc6ba4b876c623124c7cfed33bf2ce01429c 100644 (file)
@@ -52,7 +52,6 @@
 #include "wx_variant.h"
 #include "lib/config.h"
 #include "lib/cross.h"
-#include "lib/dcp_content_type.h"
 #include "lib/email.h"
 #include "lib/exceptions.h"
 #include "lib/filter.h"
@@ -311,10 +310,6 @@ private:
 #endif
                table->Add (_directory, 1, wxEXPAND);
 
-               add_label_to_sizer (table, _panel, _("Default content type"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
-               _dcp_content_type = new wxChoice (_panel, wxID_ANY);
-               table->Add (_dcp_content_type);
-
                add_label_to_sizer (table, _panel, _("Default DCP audio channels"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
                _dcp_audio_channels = new wxChoice (_panel, wxID_ANY);
                table->Add (_dcp_audio_channels);
@@ -410,13 +405,8 @@ private:
 
                _use_isdcf_name_by_default->bind(&DefaultsPage::use_isdcf_name_by_default_changed, this);
 
-               for (auto i: DCPContentType::all()) {
-                       _dcp_content_type->Append (std_to_wx (i->pretty_name ()));
-               }
-
                setup_audio_channels_choice (_dcp_audio_channels, 2);
 
-               _dcp_content_type->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::dcp_content_type_changed, this));
                _dcp_audio_channels->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::dcp_audio_channels_changed, this));
 
                _j2k_video_bit_rate->SetRange(50, 250);
@@ -449,14 +439,6 @@ private:
        void config_changed () override
        {
                auto config = Config::instance ();
-
-               auto const ct = DCPContentType::all ();
-               for (size_t i = 0; i < ct.size(); ++i) {
-                       if (ct[i] == config->default_dcp_content_type()) {
-                               _dcp_content_type->SetSelection (i);
-                       }
-               }
-
                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 ()));
@@ -590,12 +572,6 @@ private:
                Config::instance()->set_default_still_length (_still_length->GetValue ());
        }
 
-       void dcp_content_type_changed ()
-       {
-               auto ct = DCPContentType::all ();
-               Config::instance()->set_default_dcp_content_type (ct[_dcp_content_type->GetSelection()]);
-       }
-
        void standard_changed ()
        {
                Config::instance()->set_default_interop (_standard->GetSelection() == 1);
@@ -667,7 +643,6 @@ private:
        wxSpinCtrl* _kdm_duration;
        wxChoice* _kdm_duration_unit;
        CheckBox* _use_isdcf_name_by_default;
-       wxChoice* _dcp_content_type;
        wxChoice* _dcp_audio_channels;
        wxChoice* _standard;
        CheckBox* _enable_audio_language;
index 1be37c253c9aea40bb00d939c38c1185f059fd60..8ce19d5a2697bb83f436493b9d8a71663736ed55 100644 (file)
@@ -301,10 +301,5 @@ BOOST_AUTO_TEST_CASE(create_cli_defaults_test)
        auto cc = run("dcpomatic2_create test/data/flat_red.png");
        auto film = cc.make_film();
        BOOST_CHECK(!film->interop());
-
-       Config::instance()->set_default_dcp_content_type(DCPContentType::from_isdcf_name("FT"));
-       cc = run("dcpomatic2_create test/data/flat_red.png");
-       film = cc.make_film();
-       BOOST_CHECK_EQUAL(film->dcp_content_type()->isdcf_name(), "TST");
 }
 
index fe54acfc54d02a8e7b033117644d2dd4ab17d7c9..d511a06d5124f7d688b5fed8445c53c2fe08e5be 160000 (submodule)
--- a/test/data
+++ b/test/data
@@ -1 +1 @@
-Subproject commit fe54acfc54d02a8e7b033117644d2dd4ab17d7c9
+Subproject commit d511a06d5124f7d688b5fed8445c53c2fe08e5be
index 8d92b31e451fa9326e2945f5b98ae962c847fc45..c145a8b4d7be0c50619cc12a922f4bf10576eeb9 100644 (file)
@@ -120,7 +120,6 @@ setup_test_config ()
        Config::instance()->set_master_encoding_threads (boost::thread::hardware_concurrency() / 2);
        Config::instance()->set_server_encoding_threads (1);
        Config::instance()->set_server_port_base (61921);
-       Config::instance()->set_default_dcp_content_type (static_cast<DCPContentType*> (0));
        Config::instance()->set_default_audio_delay (0);
        Config::instance()->set_default_video_bit_rate(VideoEncoding::JPEG2000, 100000000);
        Config::instance()->set_default_interop (false);