X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic.cc;h=47851a21874249f67244ed168259c2c47d9ddbb6;hp=ae80a42da97c7e482d2bd926cdf3f63cc594f2af;hb=5eb8b5c3a1566aef638e9d9df03b88d320735092;hpb=73799b11bdd90ef9ddd70bdd9bc3f4e1e12bcd07 diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index ae80a42da..47851a218 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -92,6 +92,9 @@ #include #include #include +#ifdef __WXGTK__ +#include +#endif #ifdef __WXMSW__ #include #endif @@ -875,14 +878,19 @@ private: ) ); + + dcp::LocalTime from (Config::instance()->decryption_chain()->leaf().not_before()); + from.add_months (1); + dcp::LocalTime to (Config::instance()->decryption_chain()->leaf().not_after()); + to.add_months (-1); + optional kdm; try { kdm = _film->make_kdm ( Config::instance()->decryption_chain()->leaf(), vector(), d->cpl (), - dcp::LocalTime ("2012-01-01T01:00:00+00:00"), - dcp::LocalTime ("2112-01-01T01:00:00+00:00"), + from, to, dcp::MODIFIED_TRANSITIONAL_1, true, 0 @@ -913,6 +921,18 @@ private: { ExportDialog* d = new ExportDialog (this, _film->isdcf_name(true)); if (d->ShowModal() == wxID_OK) { + if (boost::filesystem::exists(d->path())) { + bool ok = confirm_dialog( + this, + wxString::Format (_("File %s already exists. Do you want to overwrite it?"), std_to_wx(d->path().string()).data()) + ); + + if (!ok) { + d->Destroy (); + return; + } + } + shared_ptr job (new TranscodeJob (_film)); if (d->format() == EXPORT_FORMAT_SUBTITLES_DCP) { job->set_encoder ( @@ -1470,6 +1490,8 @@ static const wxCmdLineEntryDesc command_line_description[] = { { wxCMD_LINE_SWITCH, "n", "new", "create new film", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_OPTION, "c", "content", "add content file / directory", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_OPTION, "d", "dcp", "add content DCP", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, + { wxCMD_LINE_SWITCH, "v", "version", "show DCP-o-matic version", wxCMD_LINE_VAL_NONE, wxCMD_LINE_PARAM_OPTIONAL }, + { wxCMD_LINE_OPTION, "", "config", "directory containing config.xml and cinemas.xml", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_PARAM, 0, 0, "film to load or create", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL }, { wxCMD_LINE_NONE, "", "", "", wxCmdLineParamType (0), 0 } }; @@ -1484,7 +1506,11 @@ public: : wxApp () , _frame (0) , _splash (0) - {} + { +#ifdef DCPOMATIC_LINUX + XInitThreads (); +#endif + } private: @@ -1612,6 +1638,11 @@ private: bool OnCmdLineParsed (wxCmdLineParser& parser) { + if (parser.Found (wxT("version"))) { + cout << "dcpomatic version " << dcpomatic_version << " " << dcpomatic_git_commit << "\n"; + exit (EXIT_SUCCESS); + } + if (parser.GetParamCount() > 0) { if (parser.Found (wxT ("new"))) { _film_to_create = wx_to_std (parser.GetParam (0)); @@ -1630,6 +1661,11 @@ private: _dcp_to_add = wx_to_std (dcp); } + wxString config; + if (parser.Found (wxT("config"), &config)) { + State::override_path = wx_to_std (config); + } + return true; }