No-op: whitespace.
[libdcp.git] / tools / dcpinfo.cc
index 1ebc4d953da17409dd1ba87675d19ffcb3822a9a..bd74387b35f1272a72aad745243591bb1f448bc4 100644 (file)
 
 */
 
-#include <iostream>
-#include <cstdlib>
-#include <boost/filesystem.hpp>
-#include <getopt.h>
 #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 <getopt.h>
+#include <boost/filesystem.hpp>
+#include <boost/foreach.hpp>
+#include <iostream>
+#include <cstdlib>
 
 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> 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> 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> reel, bool list_subtitles)
        if (!reel->main_subtitle()) {
                return;
        }
-       
-       list<SubtitleString> subs = reel->main_subtitle()->subtitle_content()->subtitles ();
-       cout << "      Subtitle: " << subs.size() << " subtitles in " << reel->main_subtitle()->subtitle_content()->language() << "\n";
+
+       list<SubtitleString> subs = reel->main_subtitle()->subtitle_asset()->subtitles ();
+       cout << "      Subtitle: " << subs.size() << " subtitles";
+       shared_ptr<InteropSubtitleAsset> iop = dynamic_pointer_cast<InteropSubtitleAsset> (reel->main_subtitle()->subtitle_asset());
+       if (iop) {
+               cout << " in " << iop->language() << "\n";
+       }
+       shared_ptr<SMPTESubtitleAsset> smpte = dynamic_pointer_cast<SMPTESubtitleAsset> (reel->main_subtitle()->subtitle_asset());
+       if (smpte && smpte->language ()) {
+               cout << " in " << smpte->language().get() << "\n";
+       }
        if (list_subtitles) {
-               for (list<SubtitleString>::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<shared_ptr<CPL> >::iterator i = cpls.begin(); i != cpls.end(); ++i) {
                cout << "  CPL: " << (*i)->annotation_text() << "\n";
-               
+
                list<shared_ptr<Reel> > reels = (*i)->reels ();
 
                int R = 1;