Add create support for some more audio channels.
authorCarl Hetherington <cth@carlh.net>
Sat, 25 Mar 2023 23:29:44 +0000 (00:29 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 29 Mar 2023 15:43:07 +0000 (17:43 +0200)
src/lib/create_cli.cc
src/tools/dcpomatic_create.cc

index 107311d59ca01130d0c67ab9a85433f5f6bcb216..2cbff6e85bc2900ec6342cccb72e7d6371d00905 100644 (file)
@@ -55,7 +55,7 @@ string CreateCLI::_help =
        "      --j2k-bandwidth <Mbit/s>  J2K bandwidth in Mbit/s\n"
        "      --left-eye                next piece of content is for the left eye\n"
        "      --right-eye               next piece of content is for the right eye\n"
-       "      --channel <channel>       next piece of content should be mapped to audio channel L, R, C, Lfe, Ls or Rs\n"
+       "      --channel <channel>       next piece of content should be mapped to audio channel L, R, C, Lfe, Ls, Rs, BsL, BsR, HI, VI\n"
        "      --gain                    next piece of content should have the given audio gain (in dB)\n"
        "      --cpl <id>                CPL ID to use from the next piece of content (which is a DCP)\n"
        "      --kdm <file>              KDM for next piece of content\n";
@@ -208,6 +208,14 @@ CreateCLI::CreateCLI (int argc, char* argv[])
                                return dcp::Channel::LS;
                        } else if (channel == "Rs") {
                                return dcp::Channel::RS;
+                       } else if (channel == "BsL") {
+                               return dcp::Channel::BSL;
+                       } else if (channel == "BsR") {
+                               return dcp::Channel::BSR;
+                       } else if (channel == "HI") {
+                               return dcp::Channel::HI;
+                       } else if (channel == "VI") {
+                               return dcp::Channel::VI;
                        } else {
                                return {};
                        }
index 62428b1a24484990e287d8f147f59e3e5d84b829..bd059e9f8e68a0c6d2250bf30fc5f40fb079ed72 100644 (file)
@@ -118,6 +118,18 @@ main (int argc, char* argv[])
                        film->set_j2k_bandwidth (*cc.j2k_bandwidth);
                }
 
+               int channels = 6;
+               for (auto cli_content: cc.content) {
+                       if (cli_content.channel) {
+                               channels = std::max(channels, static_cast<int>(*cli_content.channel) + 1);
+                       }
+               }
+               if (channels % 1) {
+                       ++channels;
+               }
+
+               film->set_audio_channels(channels);
+
                for (auto cli_content: cc.content) {
                        auto const can = boost::filesystem::canonical (cli_content.path);
                        vector<shared_ptr<Content>> film_content_list;