summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-04 00:30:58 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-04 00:30:58 +0100
commit1e558b3f3a2435ead56426e892591e85d2da6887 (patch)
treeca04513df17ba0a619865e9bf9e0c41360ab920f
parent81fc3762d30576472e2861ce8acb8e6deacfb463 (diff)
Add halign to SubtitleString's operator<< and use it for dcpinfo.
-rw-r--r--src/subtitle_string.cc6
-rw-r--r--tools/dcpinfo.cc26
2 files changed, 10 insertions, 22 deletions
diff --git a/src/subtitle_string.cc b/src/subtitle_string.cc
index 478bd4aa..cf0ddf41 100644
--- a/src/subtitle_string.cc
+++ b/src/subtitle_string.cc
@@ -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;
}
diff --git a/tools/dcpinfo.cc b/tools/dcpinfo.cc
index 1ebc4d95..c278fc2f 100644
--- a/tools/dcpinfo.cc
+++ b/tools/dcpinfo.cc
@@ -17,10 +17,6 @@
*/
-#include <iostream>
-#include <cstdlib>
-#include <boost/filesystem.hpp>
-#include <getopt.h>
#include "dcp.h"
#include "exceptions.h"
#include "reel.h"
@@ -33,6 +29,11 @@
#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";
}
}
}