From 76dcdc1b73a15b4d38bd7280af7b997f9bec7d67 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 26 Mar 2023 00:29:44 +0100 Subject: [PATCH] Add create support for some more audio channels. --- src/lib/create_cli.cc | 10 +++++++++- src/tools/dcpomatic_create.cc | 12 ++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/lib/create_cli.cc b/src/lib/create_cli.cc index 107311d59..2cbff6e85 100644 --- a/src/lib/create_cli.cc +++ b/src/lib/create_cli.cc @@ -55,7 +55,7 @@ string CreateCLI::_help = " --j2k-bandwidth 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 next piece of content should be mapped to audio channel L, R, C, Lfe, Ls or Rs\n" + " --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 CPL ID to use from the next piece of content (which is a DCP)\n" " --kdm 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 {}; } diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index 62428b1a2..bd059e9f8 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -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(*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> film_content_list; -- 2.30.2