diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-09-30 11:29:42 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-09-30 11:29:42 +0200 |
| commit | dd4786cb54373a541c970c00f173f7e1504e5c59 (patch) | |
| tree | 617df925333d822d7ef9bb4eca067146dedec814 /src/tools | |
| parent | 8833851ea6061e51a0ce429303524f9668226cec (diff) | |
Cleanup: extract some stuff to a method in CreateCLI.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic_create.cc | 39 |
1 files changed, 1 insertions, 38 deletions
diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index caaba6b38..63889a597 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -25,7 +25,6 @@ #include "lib/cross.h" #include "lib/dcp_content.h" #include "lib/dcp_content_type.h" -#include "lib/dcpomatic_log.h" #include "lib/film.h" #include "lib/image_content.h" #include "lib/job.h" @@ -92,43 +91,7 @@ main (int argc, char* argv[]) auto jm = JobManager::instance (); try { - auto film = std::make_shared<Film>(cc.output_dir); - dcpomatic_log = film->log (); - dcpomatic_log->set_types (Config::instance()->log_types()); - if (cc.template_name) { - film->use_template (cc.template_name.get()); - } - film->set_name (cc.name); - - if (cc.container_ratio) { - film->set_container (cc.container_ratio); - } - film->set_dcp_content_type (cc.dcp_content_type); - film->set_interop (cc.standard == dcp::Standard::INTEROP); - film->set_use_isdcf_name (!cc.no_use_isdcf_name); - film->set_encrypted (cc.encrypt); - film->set_three_d (cc.threed); - if (cc.twok) { - film->set_resolution (Resolution::TWO_K); - } - if (cc.fourk) { - film->set_resolution (Resolution::FOUR_K); - } - if (cc.j2k_bandwidth) { - 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); + auto film = cc.make_film(); for (auto cli_content: cc.content) { auto const can = boost::filesystem::canonical (cli_content.path); |
