X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=tools%2Fdcpinfo.cc;h=bd74387b35f1272a72aad745243591bb1f448bc4;hb=2ae92dcc97765deb2845dd07a338858aeb375cb3;hp=1ebc4d953da17409dd1ba87675d19ffcb3822a9a;hpb=d6633a73369339c419f33fb9d641f342826a3290;p=libdcp.git diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc index 1ebc4d95..bd74387b 100644 --- a/tools/dcpinfo.cc +++ b/tools/dcpinfo.cc @@ -17,28 +17,32 @@ */ -#include -#include -#include -#include #include "dcp.h" #include "exceptions.h" #include "reel.h" -#include "sound_mxf.h" -#include "picture_mxf.h" -#include "subtitle_content.h" +#include "sound_asset.h" +#include "picture_asset.h" +#include "subtitle_asset.h" #include "reel_picture_asset.h" #include "reel_sound_asset.h" #include "reel_subtitle_asset.h" #include "subtitle_string.h" +#include "interop_subtitle_asset.h" +#include "smpte_subtitle_asset.h" #include "cpl.h" #include "common.h" +#include +#include +#include +#include +#include using std::string; using std::cerr; using std::cout; using std::list; using boost::shared_ptr; +using boost::dynamic_pointer_cast; using namespace dcp; static void @@ -53,22 +57,22 @@ help (string n) static void main_picture (shared_ptr reel) { - if (reel->main_picture() && reel->main_picture()->mxf()) { + if (reel->main_picture() && reel->main_picture()->asset()) { cout << " Picture: " - << reel->main_picture()->mxf()->size().width + << reel->main_picture()->asset()->size().width << "x" - << reel->main_picture()->mxf()->size().height << "\n"; + << reel->main_picture()->asset()->size().height << "\n"; } } static void main_sound (shared_ptr reel) { - if (reel->main_sound() && reel->main_sound()->mxf()) { + if (reel->main_sound() && reel->main_sound()->asset()) { cout << " Sound: " - << reel->main_sound()->mxf()->channels() + << reel->main_sound()->asset()->channels() << " channels at " - << reel->main_sound()->mxf()->sampling_rate() << "Hz\n"; + << reel->main_sound()->asset()->sampling_rate() << "Hz\n"; } } @@ -78,25 +82,20 @@ main_subtitle (shared_ptr reel, bool list_subtitles) if (!reel->main_subtitle()) { return; } - - list subs = reel->main_subtitle()->subtitle_content()->subtitles (); - cout << " Subtitle: " << subs.size() << " subtitles in " << reel->main_subtitle()->subtitle_content()->language() << "\n"; + + list subs = reel->main_subtitle()->subtitle_asset()->subtitles (); + cout << " Subtitle: " << subs.size() << " subtitles"; + shared_ptr iop = dynamic_pointer_cast (reel->main_subtitle()->subtitle_asset()); + if (iop) { + cout << " in " << iop->language() << "\n"; + } + shared_ptr smpte = dynamic_pointer_cast (reel->main_subtitle()->subtitle_asset()); + if (smpte && smpte->language ()) { + cout << " in " << smpte->language().get() << "\n"; + } if (list_subtitles) { - for (list::const_iterator k = subs.begin(); k != subs.end(); ++k) { - cout << " " << k->text() << "\n"; - cout << " " - << "font:" << k->font().get_value_or("[default]") << "; " - << "italic:" << k->italic() << "; " - << "color:" << k->colour() << "; " - << "in:" << k->in() << "; " - << "out:" << k->out() << "; " - << "v_position:" << k->v_position() << "; " - << "v_align:" << k->v_align() << "; " - << "effect:" << k->effect() << "; " - << "effect_color:" << k->effect_colour() << "; " - << "fade_up_time:" << k->fade_up_time() << "; " - << "fade_down_time:" << k->fade_down_time() << "; " - << "size: " << k->size() << "\n"; + BOOST_FOREACH (SubtitleString const& k, subs) { + cout << k << "\n"; } } } @@ -107,7 +106,7 @@ main (int argc, char* argv[]) bool subtitles = false; bool keep_going = false; bool ignore_missing_assets = false; - + int option_index = 0; while (1) { static struct option long_options[] = { @@ -166,7 +165,7 @@ main (int argc, char* argv[]) cerr << "Could not read DCP " << argv[optind] << "; " << e.what() << "\n"; exit (EXIT_FAILURE); } - + cout << "DCP: " << boost::filesystem::path(argv[optind]).filename().string() << "\n"; dcp::filter_errors (errors, ignore_missing_assets); @@ -178,7 +177,7 @@ main (int argc, char* argv[]) for (list >::iterator i = cpls.begin(); i != cpls.end(); ++i) { cout << " CPL: " << (*i)->annotation_text() << "\n"; - + list > reels = (*i)->reels (); int R = 1;