X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_create.cc;h=caaba6b3808ba90b8a0ab7ad49633828b8e5459e;hb=b168d211622f94a5240c945c1df03b0bed48d3bc;hp=e4452b19a431229beac4d9b08aca1303af67213c;hpb=d4422f1e52b559ec7d5552eb6e5e63536b66e0de;p=dcpomatic.git diff --git a/src/tools/dcpomatic_create.cc b/src/tools/dcpomatic_create.cc index e4452b19a..caaba6b38 100644 --- a/src/tools/dcpomatic_create.cc +++ b/src/tools/dcpomatic_create.cc @@ -45,6 +45,7 @@ #include #include + using std::cerr; using std::cout; using std::dynamic_pointer_cast; @@ -53,15 +54,17 @@ using std::list; using std::make_shared; using std::shared_ptr; using std::string; +using std::vector; using boost::optional; + class SimpleSignalManager : public SignalManager { public: /* Do nothing in this method so that UI events happen in our thread when we call SignalManager::ui_idle(). */ - void wake_ui () {} + void wake_ui () override {} }; int @@ -115,12 +118,31 @@ 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(*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); - list> film_content_list; + vector> film_content_list; if (boost::filesystem::exists (can / "ASSETMAP") || (boost::filesystem::exists (can / "ASSETMAP.xml"))) { - film_content_list.push_back (make_shared(can)); + auto dcp = make_shared(can); + film_content_list.push_back (dcp); + if (cli_content.kdm) { + dcp->add_kdm (dcp::EncryptedKDM(dcp::file_to_string(*cli_content.kdm))); + } + if (cli_content.cpl) { + dcp->set_cpl(*cli_content.cpl); + } } else { /* I guess it's not a DCP */ film_content_list = content_factory (can); @@ -162,15 +184,17 @@ main (int argc, char* argv[]) for (auto i: film->content()) { auto ic = dynamic_pointer_cast (i); if (ic && ic->still()) { - ic->video->set_length (cc.still_length * 24); + ic->video->set_length(cc.still_length.get_value_or(10) * 24); } } if (jm->errors ()) { for (auto i: jm->get()) { if (i->finished_in_error()) { - cerr << i->error_summary() << "\n" - << i->error_details() << "\n"; + cerr << i->error_summary() << "\n"; + if (!i->error_details().empty()) { + cout << i->error_details() << "\n"; + } } } exit (EXIT_FAILURE);