Advanced option to allow mapping to any audio channel (#2279).
authorCarl Hetherington <cth@carlh.net>
Tue, 28 Jun 2022 22:00:55 +0000 (00:00 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 30 Jun 2022 22:02:52 +0000 (00:02 +0200)
src/lib/config.cc
src/lib/config.h
src/lib/film.cc
src/lib/util.cc
src/wx/full_config_dialog.cc
test/data

index caea995be50c96cb1879aeb647235ee219672078..aacc71edfc4b4ce12ac4481a441eb1e47231cac6 100644 (file)
@@ -101,6 +101,7 @@ Config::set_defaults ()
        _allow_any_dcp_frame_rate = false;
        _allow_any_container = false;
        _allow_96khz_audio = false;
+       _use_all_audio_channels = false;
        _show_experimental_audio_processors = false;
        _language = optional<string> ();
        _default_still_length = 10;
@@ -414,6 +415,7 @@ try
        _allow_any_dcp_frame_rate = f.optional_bool_child ("AllowAnyDCPFrameRate").get_value_or (false);
        _allow_any_container = f.optional_bool_child ("AllowAnyContainer").get_value_or (false);
        _allow_96khz_audio = f.optional_bool_child("Allow96kHzAudio").get_value_or(false);
+       _use_all_audio_channels = f.optional_bool_child("UseAllAudioChannels").get_value_or(false);
        _show_experimental_audio_processors = f.optional_bool_child ("ShowExperimentalAudioProcessors").get_value_or (false);
 
        _log_types = f.optional_number_child<int> ("LogTypes").get_value_or (LogEntry::TYPE_GENERAL | LogEntry::TYPE_WARNING | LogEntry::TYPE_ERROR);
@@ -803,6 +805,8 @@ Config::write_config () const
        root->add_child("AllowAnyContainer")->add_child_text (_allow_any_container ? "1" : "0");
        /* [XML] Allow96kHzAudio 1 to allow users to make DCPs with 96kHz audio, 0 to always make 48kHz DCPs */
        root->add_child("Allow96kHzAudio")->add_child_text(_allow_96khz_audio ? "1" : "0");
+       /* [XML] UseAllAudioChannels 1 to allow users to map audio to all 16 DCP channels, 0 to limit to the channels used in standard DCPs */
+       root->add_child("UseAllAudioChannels")->add_child_text(_use_all_audio_channels ? "1" : "0");
        /* [XML] ShowExperimentalAudioProcessors 1 to offer users the (experimental) audio upmixer processors, 0 to hide them */
        root->add_child("ShowExperimentalAudioProcessors")->add_child_text (_show_experimental_audio_processors ? "1" : "0");
        /* [XML] LogTypes Types of logging to write; a bitfield where 1 is general notes, 2 warnings, 4 errors, 8 debug information related
index 9c3650f8d00af1d8cfb0f6f2b2ad1cf33136942a..f53b8986e0ff890ebb36379ad52a9e4fca46c17f 100644 (file)
@@ -174,6 +174,10 @@ public:
                return _allow_96khz_audio;
        }
 
+       bool use_all_audio_channels () const {
+               return _use_all_audio_channels;
+       }
+
        bool show_experimental_audio_processors () const {
                return _show_experimental_audio_processors;
        }
@@ -669,6 +673,10 @@ public:
                maybe_set (_allow_96khz_audio, a);
        }
 
+       void set_use_all_audio_channels (bool a) {
+               maybe_set (_use_all_audio_channels, a);
+       }
+
        void set_show_experimental_audio_processors (bool e) {
                maybe_set (_show_experimental_audio_processors, e, SHOW_EXPERIMENTAL_AUDIO_PROCESSORS);
        }
@@ -1230,6 +1238,7 @@ private:
        */
        bool _allow_any_container;
        bool _allow_96khz_audio;
+       bool _use_all_audio_channels;
        /** Offer the upmixers in the audio processor settings */
        bool _show_experimental_audio_processors;
        boost::optional<std::string> _language;
index 4084ca59c1700ec2d5ecae874b8eb5b0732b62b5..37720025b8ca5568e8d6f8e157be952d354a7b26 100644 (file)
@@ -1755,7 +1755,7 @@ Film::audio_output_names () const
        vector<NamedChannel> n;
 
        for (int i = 0; i < audio_channels(); ++i) {
-               if (i != 8 && i != 9 && i != 15) {
+               if (Config::instance()->use_all_audio_channels() || (i != 8 && i != 9 && i != 15)) {
                        n.push_back (NamedChannel(short_audio_channel_name(i), i));
                }
        }
index eab9408ce77348c2b8af9bf48b62e4317defc829..2a21477fd5c744ab5cefad7403a743841a5a33fe 100644 (file)
@@ -594,14 +594,14 @@ short_audio_channel_name (int c)
                _("Rs"),
                _("HI"),
                _("VI"),
-               _("Lc"),
-               _("Rc"),
+               _("9"),
+               _("10"),
                _("BsL"),
                _("BsR"),
                _("DBP"),
                _("DBS"),
                _("Sign"),
-               ""
+               _("16")
        };
 
        return channels[c];
index 8fc029f747c8388413e8a684101c22cb038d439b..8554af5b989495163ffc8bd1f6bdab250d894317 100644 (file)
@@ -1495,6 +1495,10 @@ private:
                table->Add (_allow_96khz_audio, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
                table->AddSpacer (0);
 
+               _use_all_audio_channels = new CheckBox(_panel, _("Allow mapping to all audio channels"));
+               table->Add(_use_all_audio_channels, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
+               table->AddSpacer(0);
+
                _show_experimental_audio_processors = new CheckBox (_panel, _("Show experimental audio processors"));
                table->Add (_show_experimental_audio_processors, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_GAP);
                table->AddSpacer (0);
@@ -1598,6 +1602,7 @@ private:
                _allow_any_dcp_frame_rate->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::allow_any_dcp_frame_rate_changed, this));
                _allow_any_container->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::allow_any_container_changed, this));
                _allow_96khz_audio->Bind (wxEVT_CHECKBOX, boost::bind(&AdvancedPage::allow_96khz_audio_changed, this));
+               _use_all_audio_channels->Bind(wxEVT_CHECKBOX, boost::bind(&AdvancedPage::use_all_channels_changed, this));
                _show_experimental_audio_processors->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::show_experimental_audio_processors_changed, this));
                _only_servers_encode->Bind (wxEVT_CHECKBOX, boost::bind (&AdvancedPage::only_servers_encode_changed, this));
                _frames_in_memory_multiplier->Bind (wxEVT_SPINCTRL, boost::bind(&AdvancedPage::frames_in_memory_multiplier_changed, this));
@@ -1634,6 +1639,7 @@ private:
                checked_set (_allow_any_dcp_frame_rate, config->allow_any_dcp_frame_rate ());
                checked_set (_allow_any_container, config->allow_any_container ());
                checked_set (_allow_96khz_audio, config->allow_96khz_audio());
+               checked_set (_use_all_audio_channels, config->use_all_audio_channels());
                checked_set (_show_experimental_audio_processors, config->show_experimental_audio_processors ());
                checked_set (_only_servers_encode, config->only_servers_encode ());
                checked_set (_log_general, config->log_types() & LogEntry::TYPE_GENERAL);
@@ -1686,6 +1692,11 @@ private:
                Config::instance()->set_allow_96hhz_audio(_allow_96khz_audio->GetValue());
        }
 
+       void use_all_channels_changed ()
+       {
+               Config::instance()->set_use_all_audio_channels(_use_all_audio_channels->GetValue());
+       }
+
        void show_experimental_audio_processors_changed ()
        {
                Config::instance()->set_show_experimental_audio_processors(_show_experimental_audio_processors->GetValue());
@@ -1755,6 +1766,7 @@ private:
        wxCheckBox* _allow_any_dcp_frame_rate = nullptr;
        wxCheckBox* _allow_any_container = nullptr;
        wxCheckBox* _allow_96khz_audio = nullptr;
+       wxCheckBox* _use_all_audio_channels = nullptr;
        wxCheckBox* _show_experimental_audio_processors = nullptr;
        wxCheckBox* _only_servers_encode = nullptr;
        NameFormatEditor* _dcp_metadata_filename_format = nullptr;
index 5b53d149566a58f800fa867964e6d1e93104e255..375fe9911e941ccbb6c5d8c4a96be62af0792142 160000 (submodule)
--- a/test/data
+++ b/test/data
@@ -1 +1 @@
-Subproject commit 5b53d149566a58f800fa867964e6d1e93104e255
+Subproject commit 375fe9911e941ccbb6c5d8c4a96be62af0792142