3 #include <boost/filesystem.hpp>
6 #include "exceptions.h"
10 using namespace boost;
11 using namespace libdcp;
16 cerr << "Syntax: " << n << " <DCP>\n";
20 main (int argc, char* argv[])
24 static struct option long_options[] = {
25 { "version", no_argument, 0, 'v'},
26 { "help", no_argument, 0, 'h'},
30 int c = getopt_long (argc, argv, "vh", long_options, &option_index);
38 cout << "dcpdiff version " << LIBDCP_VERSION << "\n";
46 if (argc <= optind || argc > (optind + 1)) {
51 if (!filesystem::exists (argv[optind])) {
52 cerr << argv[0] << ": DCP " << argv[optind] << " not found.\n";
56 list<string> missing_mxfs;
60 dcp = new DCP (argv[optind], false);
61 } catch (FileError& e) {
62 cerr << "Could not read DCP " << argv[optind] << "; " << e.what() << " " << e.filename() << "\n";
66 cout << "DCP: " << argv[optind] << "\n"
67 << "\tLength: " << dcp->length() << "\n"
68 << "\tFrames per second: " << dcp->frames_per_second() << "\n";
70 if (!missing_mxfs.empty ()) {
71 cout << "\tmissing MXFs: ";
72 for (list<string>::const_iterator i = missing_mxfs.begin(); i != missing_mxfs.end(); ++i) {
78 list<shared_ptr<const Reel> > reels = dcp->reels ();
81 for (list<shared_ptr<const Reel> >::const_iterator i = reels.begin(); i != reels.end(); ++i) {
82 cout << "Reel " << R << "\n";
83 cout << "\tContains: ";
84 if ((*i)->main_picture()) {
87 if ((*i)->main_sound()) {
90 if ((*i)->main_subtitle()) {