X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Ftools%2Fdcpomatic_cli.cc;h=5e55b4da273d93e93ff1ad749a228d046d896269;hb=e64cc1c9f007a2654c6f6cba7110584ed460da05;hp=dae904eb44335199a54fdcfb081a46c9bbd445ee;hpb=8a8c977c12fc65f1f50ea05099387e0fc8840e7d;p=dcpomatic.git diff --git a/src/tools/dcpomatic_cli.cc b/src/tools/dcpomatic_cli.cc index dae904eb4..5e55b4da2 100644 --- a/src/tools/dcpomatic_cli.cc +++ b/src/tools/dcpomatic_cli.cc @@ -196,6 +196,62 @@ list_servers () } +bool +show_jobs_on_console (bool progress) +{ + bool first = true; + bool error = false; + while (true) { + + dcpomatic_sleep_seconds (5); + + auto jobs = JobManager::instance()->get(); + + if (!first && progress) { + for (size_t i = 0; i < jobs.size(); ++i) { + cout << "\033[1A\033[2K"; + } + cout.flush (); + } + + first = false; + + for (auto i: jobs) { + if (progress) { + cout << i->name(); + if (!i->sub_name().empty()) { + cout << "; " << i->sub_name(); + } + cout << ": "; + + if (i->progress ()) { + cout << i->status() << " \n"; + } else { + cout << ": Running \n"; + } + } + + if (!progress && i->finished_in_error()) { + /* We won't see this error if we haven't been showing progress, + so show it now. + */ + cout << i->status() << "\n"; + } + + if (i->finished_in_error()) { + error = true; + } + } + + if (!JobManager::instance()->work_to_do()) { + break; + } + } + + return error; +} + + int main (int argc, char* argv[]) { @@ -399,7 +455,7 @@ main (int argc, char* argv[]) auto job = std::make_shared(film, behaviour); job->set_encoder ( std::make_shared ( - film, job, *export_filename, *export_format == "mp4" ? ExportFormat::H264_AAC : ExportFormat::PRORES, false, false, false, 23 + film, job, *export_filename, *export_format == "mp4" ? ExportFormat::H264_AAC : ExportFormat::PRORES_HQ, false, false, false, 23 ) ); JobManager::instance()->add (job); @@ -412,7 +468,6 @@ main (int argc, char* argv[]) } } - make_dcp (film, behaviour); bool const error = show_jobs_on_console (progress); if (keep_going) {