- argument_option(i, argc, argv, "", "--content-ratio", &claimed, &error, &content_ratio_string);
- argument_option(i, argc, argv, "-s", "--still-length", &claimed, &error, &still_length);
- argument_option(i, argc, argv, "", "--standard", &claimed, &error, &standard_string);
- argument_option(i, argc, argv, "", "--config", &claimed, &error, &config_dir_string);
- argument_option(i, argc, argv, "-o", "--output", &claimed, &error, &output_dir_string);
+ argument_option(i, argc, argv, "-s", "--still-length", &claimed, &error, &still_length, string_to_nonzero_int);
+ /* See comment below about --cpl */
+ argument_option(i, argc, argv, "", "--standard", &claimed, &error, &standard_string, string_to_string);
+ argument_option(i, argc, argv, "", "--config", &claimed, &error, &config_dir, string_to_path);
+ argument_option(i, argc, argv, "-o", "--output", &claimed, &error, &output_dir, string_to_path);
+ argument_option(i, argc, argv, "", "--j2k-bandwidth", &claimed, &error, &j2k_bandwidth_int);
+
+ std::function<optional<dcp::Channel> (string)> convert_channel = [](string channel) -> optional<dcp::Channel>{
+ if (channel == "L") {
+ return dcp::Channel::LEFT;
+ } else if (channel == "R") {
+ return dcp::Channel::RIGHT;
+ } else if (channel == "C") {
+ return dcp::Channel::CENTRE;
+ } else if (channel == "Lfe") {
+ return dcp::Channel::LFE;
+ } else if (channel == "Ls") {
+ 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 {};
+ }
+ };
+
+ argument_option(i, argc, argv, "", "--channel", &claimed, &error, &channel, convert_channel);
+ argument_option(i, argc, argv, "", "--gain", &claimed, &error, &gain);
+ argument_option(i, argc, argv, "", "--kdm", &claimed, &error, &kdm, string_to_path);
+ /* It shouldn't be necessary to use this string_to_string here, but using the other argument_option()
+ * causes an odd compile error on Ubuntu 18.04.
+ */
+ argument_option(i, argc, argv, "", "--cpl", &claimed, &error, &cpl, string_to_string);