" --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 or Rs\n"
+ " --gain next piece of content should have the given audio gain (in dB)\n";
template <class T>
int j2k_bandwidth_int = 0;
auto next_frame_type = VideoFrameType::TWO_D;
optional<dcp::Channel> channel;
+ optional<float> gain;
int i = 1;
while (i < argc) {
};
argument_option(i, argc, argv, "", "--channel", &claimed, &error, &channel, convert_channel);
+ argument_option(i, argc, argv, "", "--gain", &claimed, &error, &gain);
if (!claimed) {
if (a.length() > 2 && a.substr(0, 2) == "--") {
c.path = a;
c.frame_type = next_frame_type;
c.channel = channel;
+ c.gain = gain;
content.push_back (c);
next_frame_type = VideoFrameType::TWO_D;
channel = {};
+ gain = {};
}
}
cc = run ("dcpomatic2_create --channel foo fred.wav");
BOOST_REQUIRE (cc.error);
BOOST_CHECK (boost::algorithm::starts_with(*cc.error, "dcpomatic2_create: foo is not valid for --channel"));
+
+ cc = run ("dcpomatic2_create fred.wav --gain -6 jim.wav --gain 2 sheila.wav");
+ BOOST_REQUIRE_EQUAL (cc.content.size(), 3U);
+ BOOST_CHECK_EQUAL (cc.content[0].path, "fred.wav");
+ BOOST_CHECK (!cc.content[0].gain);
+ BOOST_CHECK_EQUAL (cc.content[1].path, "jim.wav");
+ BOOST_CHECK_CLOSE (*cc.content[1].gain, -6, 0.001);
+ BOOST_CHECK_EQUAL (cc.content[2].path, "sheila.wav");
+ BOOST_CHECK_CLOSE (*cc.content[2].gain, 2, 0.001);
}