2 Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
26 #include "transcode_job.h"
27 #include "make_dcp_job.h"
28 #include "job_manager.h"
29 #include "ab_transcode_job.h"
34 using namespace boost;
39 cerr << "Syntax: " << n << " [--help] [--deps] [--film <film>]\n";
43 main (int argc, char* argv[])
48 static struct option long_options[] = {
49 { "help", no_argument, 0, 'h'},
50 { "deps", no_argument, 0, 'd'},
51 { "film", required_argument, 0, 'f'},
56 int c = getopt_long (argc, argv, "hdf:", long_options, &option_index);
67 cout << dependency_version_summary () << "\n";
75 if (film_dir.empty ()) {
84 film = new Film (film_dir, true);
85 } catch (std::exception& e) {
86 cerr << argv[0] << ": error reading film `" << film_dir << "' (" << e.what() << ")\n";
91 if (film->dcp_ab ()) {
94 cout << "DCP for " << film->name() << "\n";
95 cout << "Content: " << film->content() << "\n";
96 pair<string, string> const f = Filter::ffmpeg_strings (film->filters ());
97 cout << "Filters: " << f.first << " " << f.second << "\n";
99 film->make_dcp (true);
101 list<shared_ptr<Job> > jobs = JobManager::instance()->get ();
103 bool all_done = false;
110 cout << "\033[" << jobs.size() << "A";
117 for (list<shared_ptr<Job> >::iterator i = jobs.begin(); i != jobs.end(); ++i) {
118 cout << (*i)->name() << ": ";
120 float const p = (*i)->overall_progress ();
123 cout << (*i)->status() << " \n";
125 cout << ": Running \n";
128 if (!(*i)->finished ()) {