Add halign to SubtitleString's operator<< and use it for dcpinfo.
authorCarl Hetherington <cth@carlh.net>
Wed, 3 Jun 2015 23:30:58 +0000 (00:30 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 3 Jun 2015 23:30:58 +0000 (00:30 +0100)
src/subtitle_string.cc
tools/dcpinfo.cc

index 478bd4aadce34fab0b3427b16134dbff88061173..cf0ddf41623b4ac4277a6b019f8419ad96d998d7 100644 (file)
@@ -113,9 +113,9 @@ dcp::operator<< (ostream& s, SubtitleString const & sub)
        }
        
        s << ", size " << sub.size() << ", aspect " << sub.aspect_adjust() << ", colour " << sub.colour()
-         << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align()) << ",\n"
-         << ", hpos " << sub.h_position() << ", halign " << ((int) sub.h_align()) << ";\n"
-         << "effect " << ((int) sub.effect()) << ", effect colour " << sub.effect_colour();
+         << ", vpos " << sub.v_position() << ", valign " << ((int) sub.v_align())
+         << ", hpos " << sub.h_position() << ", halign " << ((int) sub.h_align())
+         << "effect " << ((int) sub.effect()) << ", effect colour " << sub.effect_colour();
 
        return s;
 }
index 1ebc4d953da17409dd1ba87675d19ffcb3822a9a..c278fc2f431097c6d809cd1c64c1a056ed9a7b13 100644 (file)
 
 */
 
-#include <iostream>
-#include <cstdlib>
-#include <boost/filesystem.hpp>
-#include <getopt.h>
 #include "dcp.h"
 #include "exceptions.h"
 #include "reel.h"
 #include "subtitle_string.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;
@@ -82,21 +83,8 @@ main_subtitle (shared_ptr<Reel> reel, bool list_subtitles)
        list<SubtitleString> subs = reel->main_subtitle()->subtitle_content()->subtitles ();
        cout << "      Subtitle: " << subs.size() << " subtitles in " << reel->main_subtitle()->subtitle_content()->language() << "\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";
                }
        }
 }