summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-03-26 00:29:44 +0100
committerCarl Hetherington <cth@carlh.net>2023-03-29 17:43:07 +0200
commit76dcdc1b73a15b4d38bd7280af7b997f9bec7d67 (patch)
tree61102ab1323f35c936051aa54ffb7ff9da000607
parentdf0e4e0278e66a27f8f3980e53d262332695f679 (diff)
Add create support for some more audio channels.
-rw-r--r--src/lib/create_cli.cc10
-rw-r--r--src/tools/dcpomatic_create.cc12
2 files changed, 21 insertions, 1 deletions
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 <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 {};
}
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<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;