Remove default container configuration option.
authorCarl Hetherington <cth@carlh.net>
Tue, 22 Nov 2022 23:01:54 +0000 (00:01 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 28 Nov 2022 23:15:02 +0000 (00:15 +0100)
I think this is basically useless now that DoM guesses a good container
when the first video is added.  It made more sense before we did that.

src/lib/config.cc
src/lib/config.h
src/lib/film.cc
src/wx/full_config_dialog.cc
test/data
test/test.cc

index 6984c406440d46ae4d795eae9319d6b3f1e2c3e1..235bace7b78f6b9c62cc30e450ee9c0a233c747e 100644 (file)
@@ -106,7 +106,6 @@ Config::set_defaults ()
        _show_experimental_audio_processors = false;
        _language = optional<string> ();
        _default_still_length = 10;
-       _default_container = Ratio::from_id ("185");
        _default_dcp_content_type = DCPContentType::from_isdcf_name ("FTR");
        _default_dcp_audio_channels = 6;
        _default_j2k_bandwidth = 150000000;
@@ -334,16 +333,6 @@ try
 
        _language = f.optional_string_child ("Language");
 
-       auto c = f.optional_string_child ("DefaultContainer");
-       if (c) {
-               _default_container = Ratio::from_id (c.get ());
-       }
-
-       if (_default_container && !_default_container->used_for_container()) {
-               Warning (_("Your default container is not valid and has been changed to Flat (1.85:1)"));
-               _default_container = Ratio::from_id ("185");
-       }
-
        _default_dcp_content_type = DCPContentType::from_isdcf_name(f.optional_string_child("DefaultDCPContentType").get_value_or("FTR"));
        _default_dcp_audio_channels = f.optional_number_child<int>("DefaultDCPAudioChannels").get_value_or (6);
 
@@ -735,13 +724,6 @@ Config::write_config () const
                /* [XML:opt] Language Language to use in the GUI e.g. <code>fr_FR</code>. */
                root->add_child("Language")->add_child_text (_language.get());
        }
-       if (_default_container) {
-               /* [XML:opt] DefaultContainer ID of default container
-                  to use when creating new films (<code>185</code>,<code>239</code> or
-                  <code>190</code>).
-               */
-               root->add_child("DefaultContainer")->add_child_text (_default_container->id ());
-       }
        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>,
index 9e84a120b822755bf667e32b024ba16374bc9537..c86622427360ee2833e9c7ad129dab56cbbb43ec 100644 (file)
@@ -194,10 +194,6 @@ public:
                return _default_still_length;
        }
 
-       Ratio const * default_container () const {
-               return _default_container;
-       }
-
        DCPContentType const * default_dcp_content_type () const {
                return _default_dcp_content_type;
        }
@@ -722,10 +718,6 @@ public:
                maybe_set (_default_still_length, s);
        }
 
-       void set_default_container (Ratio const * c) {
-               maybe_set (_default_container, c);
-       }
-
        void set_default_dcp_content_type (DCPContentType const * t) {
                maybe_set (_default_dcp_content_type, t);
        }
@@ -1289,7 +1281,6 @@ private:
        boost::optional<std::string> _language;
        /** Default length of still image content (seconds) */
        int _default_still_length;
-       Ratio const * _default_container;
        DCPContentType const * _default_dcp_content_type;
        int _default_dcp_audio_channels;
        std::string _dcp_issuer;
index d5597b5a12dfa49b13255fd49b42f7fd38a65977..7d713c0411ec22fd26b0199328532056c4c1ebd5 100644 (file)
@@ -156,7 +156,7 @@ Film::Film (optional<boost::filesystem::path> dir)
        : _playlist (new Playlist)
        , _use_isdcf_name (Config::instance()->use_isdcf_name_by_default())
        , _dcp_content_type (Config::instance()->default_dcp_content_type ())
-       , _container (Config::instance()->default_container ())
+       , _container(Ratio::from_id("185"))
        , _resolution (Resolution::TWO_K)
        , _encrypted (false)
        , _context_id (dcp::make_uuid ())
index c688109c9a8ee640129897293700e94c56759b92..ba596162ec6c432dabe10838e8122c1dfe5b80e2 100644 (file)
@@ -285,10 +285,6 @@ private:
 #endif
                table->Add (_directory, 1, wxEXPAND);
 
-               add_label_to_sizer (table, _panel, _("Default container"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
-               _container = new wxChoice (_panel, wxID_ANY);
-               table->Add (_container);
-
                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);
@@ -369,12 +365,6 @@ private:
 
                _use_isdcf_name_by_default->bind(&DefaultsPage::use_isdcf_name_by_default_changed, this);
 
-               for (auto i: Ratio::containers()) {
-                       _container->Append (std_to_wx(i->container_nickname()));
-               }
-
-               _container->Bind (wxEVT_CHOICE, boost::bind (&DefaultsPage::container_changed, this));
-
                for (auto i: DCPContentType::all()) {
                        _dcp_content_type->Append (std_to_wx (i->pretty_name ()));
                }
@@ -407,13 +397,6 @@ private:
        {
                auto config = Config::instance ();
 
-               auto containers = Ratio::containers ();
-               for (size_t i = 0; i < containers.size(); ++i) {
-                       if (containers[i] == config->default_container()) {
-                               _container->SetSelection (i);
-                       }
-               }
-
                auto const ct = DCPContentType::all ();
                for (size_t i = 0; i < ct.size(); ++i) {
                        if (ct[i] == config->default_dcp_content_type()) {
@@ -541,12 +524,6 @@ private:
                Config::instance()->set_default_still_length (_still_length->GetValue ());
        }
 
-       void container_changed ()
-       {
-               auto ratio = Ratio::containers ();
-               Config::instance()->set_default_container (ratio[_container->GetSelection()]);
-       }
-
        void dcp_content_type_changed ()
        {
                auto ct = DCPContentType::all ();
@@ -591,7 +568,6 @@ private:
        wxSpinCtrl* _kdm_duration;
        wxChoice* _kdm_duration_unit;
        CheckBox* _use_isdcf_name_by_default;
-       wxChoice* _container;
        wxChoice* _dcp_content_type;
        wxChoice* _dcp_audio_channels;
        wxChoice* _standard;
index d13024105c42ea0019c991d6d99a4b6ebb9bf772..4a9a6988520e62128562a0ccfb4fed84a7f1dd63 160000 (submodule)
--- a/test/data
+++ b/test/data
@@ -1 +1 @@
-Subproject commit d13024105c42ea0019c991d6d99a4b6ebb9bf772
+Subproject commit 4a9a6988520e62128562a0ccfb4fed84a7f1dd63
index 3a6d7d17467f17e2dccdf07502acf3764840dfaf..b2a0cd5acfcaad18aaca3c13bcae9b13e46202e9 100644 (file)
@@ -110,7 +110,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_container (Ratio::from_id ("185"));
        Config::instance()->set_default_dcp_content_type (static_cast<DCPContentType*> (0));
        Config::instance()->set_default_audio_delay (0);
        Config::instance()->set_default_j2k_bandwidth (100000000);