diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-03-03 22:10:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-03-08 00:12:07 +0100 |
| commit | 641f5f2f61b77d79cb1e8c737cda0766b1ee2de8 (patch) | |
| tree | 6195f00f8e48e64dc8765d62604a9d8056191de0 /src/lib/encode_cli.cc | |
| parent | 27f9ce96db8b800b301ad3b21fb81355e982941a (diff) | |
Support some more grok configuration in the dcpomatic2_cli.
Diffstat (limited to 'src/lib/encode_cli.cc')
| -rw-r--r-- | src/lib/encode_cli.cc | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/lib/encode_cli.cc b/src/lib/encode_cli.cc index 7e9c25a6a..f28b93421 100644 --- a/src/lib/encode_cli.cc +++ b/src/lib/encode_cli.cc @@ -402,7 +402,9 @@ encode_cli(int argc, char* argv[], function<void (string)> out, function<void () #ifdef DCPOMATIC_GROK if (command == "config-params") { out("Configurable parameters:\n\n"); - out(" grok-licence licence string for using the Grok JPEG2000 encoder\n"); + out(" grok-licence licence string for using the Grok JPEG2000 encoder\n"); + out(" grok-enable 1 to enable the Grok encoder, 0 to disable it\n"); + out(" grok-binary-location directory containing Grok binaries\n"); return {}; } @@ -413,11 +415,21 @@ encode_cli(int argc, char* argv[], function<void (string)> out, function<void () auto grok = Config::instance()->grok(); if (parameter == "grok-licence") { grok.licence = value; - Config::instance()->set_grok(grok); - Config::instance()->write(); + } else if (parameter == "grok-enable") { + if (value == "1") { + grok.enable = true; + } else if (value == "0") { + grok.enable = false; + } else { + return fmt::format("Invalid value {} for grok-enable (use 1 to enable, 0 to disable)", value); + } + } else if (parameter == "grok-binary-location") { + grok.binary_location = value; } else { return fmt::format("Unrecognised configuration parameter `{}'", parameter); } + Config::instance()->set_grok(grok); + Config::instance()->write(); } else { return fmt::format("Missing configuration parameter: use {} config <parameter> <value>", program_name); } |
