diff options
| author | Carl Hetherington <cth@carlh.net> | 2015-12-16 20:35:54 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2015-12-16 20:35:54 +0000 |
| commit | 5877be91301e5dd54ca125c0acd7bfb1ecc3dcd6 (patch) | |
| tree | 96952a50aeb4f68ab458f8191a3d464f8ced7aa7 | |
| parent | 462902f22a930c52d6d4ac4ac9097d078108b568 (diff) | |
No-op; remove trailing whitespace.
| -rw-r--r-- | src/dcp_reader.h | 6 | ||||
| -rw-r--r-- | src/font_size.h | 12 | ||||
| -rw-r--r-- | src/raw_subtitle.h | 6 | ||||
| -rw-r--r-- | src/reader.h | 2 | ||||
| -rw-r--r-- | src/reader_factory.cc | 2 | ||||
| -rw-r--r-- | src/smpte_dcp_reader.cc | 8 | ||||
| -rw-r--r-- | src/stl_binary_tables.cc | 10 | ||||
| -rw-r--r-- | src/stl_binary_tables.h | 6 | ||||
| -rw-r--r-- | src/stl_binary_writer.cc | 20 | ||||
| -rw-r--r-- | src/sub_time.h | 10 | ||||
| -rw-r--r-- | src/subtitle.cc | 2 | ||||
| -rw-r--r-- | src/subtitle.h | 10 | ||||
| -rw-r--r-- | src/vertical_position.cc | 2 | ||||
| -rw-r--r-- | src/vertical_position.h | 4 | ||||
| -rw-r--r-- | src/vertical_reference.cc | 2 | ||||
| -rw-r--r-- | src/vertical_reference.h | 2 | ||||
| -rw-r--r-- | src/xml.h | 6 | ||||
| -rw-r--r-- | test/stl_binary_writer_test.cc | 4 | ||||
| -rw-r--r-- | test/stl_text_reader_test.cc | 14 | ||||
| -rw-r--r-- | test/time_test.cc | 2 | ||||
| -rw-r--r-- | test/vertical_position_test.cc | 6 |
21 files changed, 68 insertions, 68 deletions
diff --git a/src/dcp_reader.h b/src/dcp_reader.h index f749f82..82a211c 100644 --- a/src/dcp_reader.h +++ b/src/dcp_reader.h @@ -38,7 +38,7 @@ namespace dcp { */ class DCPReader : public Reader { -protected: +protected: struct ParseState { std::list<boost::shared_ptr<dcp::Font> > font_nodes; @@ -49,11 +49,11 @@ protected: void parse_common (cxml::NodePtr root, boost::optional<int> tcr); std::string _id; - + private: void parse_node (xmlpp::Node const * node, ParseState& parse_state, boost::optional<int> tcr); void maybe_add_subtitle (std::string text, ParseState const & parse_state); - + std::string _reel_number; std::string _language; }; diff --git a/src/font_size.h b/src/font_size.h index 6f4f8a5..6439c8f 100644 --- a/src/font_size.h +++ b/src/font_size.h @@ -36,7 +36,7 @@ public: void set_proportional (float p) { _proportional = p; } - + void set_points (int p) { _points = p; } @@ -44,20 +44,20 @@ public: boost::optional<float> proportional () const { return _proportional; } - + boost::optional<int> points () const { return _points; } - + float proportional (int screen_height_in_points) const; int points (int screen_height_in_points) const; - -private: + +private: /** as a proportion of screen height */ boost::optional<float> _proportional; /** in points */ boost::optional<int> _points; - + }; } diff --git a/src/raw_subtitle.h b/src/raw_subtitle.h index a27329a..2a202c1 100644 --- a/src/raw_subtitle.h +++ b/src/raw_subtitle.h @@ -54,7 +54,7 @@ public: boost::optional<Effect> effect; boost::optional<Colour> effect_colour; - + Colour colour; bool bold; ///< true to use a bold version of font bool italic; ///< true to use an italic version of font @@ -67,12 +67,12 @@ public: Time from; /** to time */ Time to; - + boost::optional<Time> fade_up; boost::optional<Time> fade_down; }; -bool operator< (RawSubtitle const &, RawSubtitle const &); +bool operator< (RawSubtitle const &, RawSubtitle const &); } diff --git a/src/reader.h b/src/reader.h index 091df61..08474f6 100644 --- a/src/reader.h +++ b/src/reader.h @@ -36,7 +36,7 @@ class Reader { public: virtual ~Reader () {} - + std::list<RawSubtitle> subtitles () const { return _subs; } diff --git a/src/reader_factory.cc b/src/reader_factory.cc index 05634c0..6c0259d 100644 --- a/src/reader_factory.cc +++ b/src/reader_factory.cc @@ -50,7 +50,7 @@ sub::reader_factory (boost::filesystem::path file_name) return shared_ptr<Reader> (new SMPTEDCPReader (file_name, false)); } } - + if (ext == ".mxf") { /* Assume this is some MXF-wrapped SMPTE subtitles */ return shared_ptr<Reader> (new SMPTEDCPReader (file_name, true)); diff --git a/src/smpte_dcp_reader.cc b/src/smpte_dcp_reader.cc index 6014196..606d9e5 100644 --- a/src/smpte_dcp_reader.cc +++ b/src/smpte_dcp_reader.cc @@ -36,14 +36,14 @@ using namespace sub; SMPTEDCPReader::SMPTEDCPReader (boost::filesystem::path file, bool mxf) { shared_ptr<cxml::Document> xml (new cxml::Document ("SubtitleReel")); - + if (mxf) { ASDCP::TimedText::MXFReader reader; Kumu::Result_t r = reader.OpenRead (file.string().c_str ()); if (ASDCP_FAILURE (r)) { boost::throw_exception (MXFError ("could not open MXF file for reading")); } - + string s; reader.ReadTimedTextResource (s, 0, 0); stringstream t; @@ -52,7 +52,7 @@ SMPTEDCPReader::SMPTEDCPReader (boost::filesystem::path file, bool mxf) ASDCP::WriterInfo info; reader.FillWriterInfo (info); - + char buffer[64]; Kumu::bin2UUIDhex (info.AssetUUID, ASDCP::UUIDlen, buffer, sizeof (buffer)); _id = buffer; @@ -60,7 +60,7 @@ SMPTEDCPReader::SMPTEDCPReader (boost::filesystem::path file, bool mxf) xml->read_file (file); _id = xml->string_child("Id").substr (9); } - + _load_font_nodes = type_children<dcp::SMPTELoadFont> (xml, "LoadFont"); parse_common (xml, xml->number_child<int> ("TimeCodeRate")); diff --git a/src/stl_binary_tables.cc b/src/stl_binary_tables.cc index 9aaf4b8..f843421 100644 --- a/src/stl_binary_tables.cc +++ b/src/stl_binary_tables.cc @@ -84,7 +84,7 @@ description_to_enum (string d, map<F, STLBinaryCode<E> > const & m) return boost::optional<E> (); } - + DisplayStandard STLBinaryTables::display_standard_file_to_enum (string s) const { @@ -150,13 +150,13 @@ STLBinaryTables::comment_enum_to_file (Comment v) const { return enum_to_file (v, _comment_map); } - + string STLBinaryTables::display_standard_enum_to_description (DisplayStandard v) const { return enum_to_description (v, _display_standard_map); } - + string STLBinaryTables::language_group_enum_to_description (LanguageGroup v) const { @@ -205,13 +205,13 @@ STLBinaryTables::STLBinaryTables () code<DisplayStandard, string> (_display_standard_map, "0", DISPLAY_STANDARD_OPEN_SUBTITLING, "Open subtitling"); code<DisplayStandard, string> (_display_standard_map, "1", DISPLAY_STANDARD_LEVEL_1_TELETEXT, "Level 1 teletext"); code<DisplayStandard, string> (_display_standard_map, "2", DISPLAY_STANDARD_LEVEL_2_TELETEXT, "Level 2 teletext"); - + code<LanguageGroup, string> (_language_group_map, "00", LANGUAGE_GROUP_LATIN, "Latin"); code<LanguageGroup, string> (_language_group_map, "01", LANGUAGE_GROUP_LATIN_CYRILLIC, "Latin/Cyrillic"); code<LanguageGroup, string> (_language_group_map, "02", LANGUAGE_GROUP_LATIN_ARABIC, "Latin/Arabic"); code<LanguageGroup, string> (_language_group_map, "03", LANGUAGE_GROUP_LATIN_GREEK, "Latin/Greek"); code<LanguageGroup, string> (_language_group_map, "04", LANGUAGE_GROUP_LATIN_HEBREW, "Latin/Hebrew"); - + code<Language, string> (_language_map, "00", LANGUAGE_UNKNOWN, "Unknown"); code<Language, string> (_language_map, "01", LANGUAGE_ALBANIAN, "Albanian"); code<Language, string> (_language_map, "02", LANGUAGE_BRETON, "Breton"); diff --git a/src/stl_binary_tables.h b/src/stl_binary_tables.h index adaae82..4a6a7d8 100644 --- a/src/stl_binary_tables.h +++ b/src/stl_binary_tables.h @@ -32,7 +32,7 @@ enum DisplayStandard { DISPLAY_STANDARD_LEVEL_1_TELETEXT, DISPLAY_STANDARD_LEVEL_2_TELETEXT }; - + enum LanguageGroup { LANGUAGE_GROUP_LATIN, LANGUAGE_GROUP_LATIN_CYRILLIC, @@ -186,7 +186,7 @@ public: : value (v) , description (d) {} - + T value; std::string description; }; @@ -222,7 +222,7 @@ public: boost::optional<Language> language_description_to_enum (std::string) const; -private: +private: std::map<std::string, STLBinaryCode<DisplayStandard> > _display_standard_map; std::map<std::string, STLBinaryCode<LanguageGroup> > _language_group_map; std::map<std::string, STLBinaryCode<Language> > _language_map; diff --git a/src/stl_binary_writer.cc b/src/stl_binary_writer.cc index 43b0adf..b9bd7e0 100644 --- a/src/stl_binary_writer.cc +++ b/src/stl_binary_writer.cc @@ -63,7 +63,7 @@ static void put_string (char* p, unsigned int n, string s) { assert (s.length() <= n); - + memcpy (p, s.c_str (), s.length ()); memset (p + s.length(), ' ', n - s.length ()); } @@ -123,7 +123,7 @@ sub::write_stl_binary ( assert (publisher.size() <= 32); assert (editor_name.size() <= 32); assert (editor_contact_details.size() <= 32); - + char* buffer = new char[1024]; memset (buffer, 0, 1024); ofstream output (file_name.string().c_str ()); @@ -144,7 +144,7 @@ sub::write_stl_binary ( ++lines; } } - + /* Code page: 850 */ put_string (buffer + 0, "850"); /* Disk format code */ @@ -256,12 +256,12 @@ sub::write_stl_binary ( put_int_as_int (buffer + 14, tables.justification_enum_to_file (JUSTIFICATION_NONE), 1); /* Comment flag */ put_int_as_int (buffer + 15, tables.comment_enum_to_file (COMMENT_NO), 1); - + /* Text */ string text; bool italic = false; bool underline = false; - + for (list<Block>::const_iterator k = j->blocks.begin(); k != j->blocks.end(); ++k) { if (k->underline && !underline) { text += "\x82"; @@ -277,20 +277,20 @@ sub::write_stl_binary ( text += "\x81"; italic = false; } - + text += utf16_to_iso6937 (utf_to_utf<wchar_t> (k->text)); } - + text += "\x8A"; - + if (text.length() > 111) { text = text.substr (111); } - + while (text.length() < 112) { text += "\x8F"; } - + put_string (buffer + 16, text); output.write (buffer, 128); diff --git a/src/sub_time.h b/src/sub_time.h index 22178e9..7abdedb 100644 --- a/src/sub_time.h +++ b/src/sub_time.h @@ -23,7 +23,7 @@ #include <boost/optional.hpp> namespace sub { - + class Rational { public: @@ -31,7 +31,7 @@ public: : numerator (numerator_) , denominator (denominator_) {} - + int numerator; int denominator; @@ -59,7 +59,7 @@ public: static Time from_hmsf (int h, int m, int s, int f, boost::optional<Rational> rate = boost::optional<Rational> ()); static Time from_hms (int h, int m, int s, int ms); - + private: friend bool operator< (Time const & a, Time const & b); friend bool operator> (Time const & a, Time const & b); @@ -71,7 +71,7 @@ private: , _frames (frames) , _rate (rate) {} - + int _seconds; int _frames; boost::optional<Rational> _rate; @@ -82,7 +82,7 @@ bool operator> (Time const & a, Time const & b); bool operator== (Time const & a, Time const & b); bool operator!= (Time const & a, Time const & b); std::ostream& operator<< (std::ostream& s, Time const & t); - + } #endif diff --git a/src/subtitle.cc b/src/subtitle.cc index d828628..663c161 100644 --- a/src/subtitle.cc +++ b/src/subtitle.cc @@ -59,5 +59,5 @@ Block::Block (RawSubtitle s) , italic (s.italic) , underline (s.underline) { - + } diff --git a/src/subtitle.h b/src/subtitle.h index 3906314..2d22dac 100644 --- a/src/subtitle.h +++ b/src/subtitle.h @@ -49,7 +49,7 @@ public: /** Construct a Block taking any relevant information from a RawSubtitle */ Block (RawSubtitle s); - + /** Subtitle text in UTF-8 */ std::string text; boost::optional<std::string> font; @@ -59,7 +59,7 @@ public: boost::optional<Effect> effect; boost::optional<Colour> effect_colour; - + Colour colour; bool bold; ///< true to use a bold version of font bool italic; ///< true to use an italic version of font @@ -75,7 +75,7 @@ class Line { public: Line () {} - + /** Construct a Line taking any relevant information from a RawSubtitle */ Line (RawSubtitle s); @@ -101,12 +101,12 @@ public: /** Construct a Line taking any relevant information from a RawSubtitle */ Subtitle (RawSubtitle s); - + /** from time */ Time from; /** to time */ Time to; - + boost::optional<Time> fade_up; boost::optional<Time> fade_down; diff --git a/src/vertical_position.cc b/src/vertical_position.cc index 5f7d0d0..9801e4d 100644 --- a/src/vertical_position.cc +++ b/src/vertical_position.cc @@ -30,7 +30,7 @@ VerticalPosition::fraction_from_screen_top () const } float const prop = proportional ? proportional.get() : (float (line.get()) / lines.get ()); - + switch (reference.get ()) { case TOP_OF_SCREEN: return prop; diff --git a/src/vertical_position.h b/src/vertical_position.h index 9f04056..7bc057e 100644 --- a/src/vertical_position.h +++ b/src/vertical_position.h @@ -39,13 +39,13 @@ public: boost::optional<int> lines; /** reference point */ boost::optional<VerticalReference> reference; - + bool operator== (VerticalPosition const & other) const; bool operator< (VerticalPosition const & other) const; float fraction_from_screen_top () const; }; - + } #endif diff --git a/src/vertical_reference.cc b/src/vertical_reference.cc index 3f9219b..7dff965 100644 --- a/src/vertical_reference.cc +++ b/src/vertical_reference.cc @@ -34,6 +34,6 @@ sub::string_to_vertical_reference (string s) } else if (s == "bottom") { return BOTTOM_OF_SCREEN; } - + throw XMLError ("unknown subtitle valign type"); } diff --git a/src/vertical_reference.h b/src/vertical_reference.h index 4bdcde8..8f5d899 100644 --- a/src/vertical_reference.h +++ b/src/vertical_reference.h @@ -33,7 +33,7 @@ enum VerticalReference }; VerticalReference string_to_vertical_reference (std::string s); - + } #endif @@ -48,7 +48,7 @@ template <class T> boost::shared_ptr<T> type_child (boost::shared_ptr<const cxml::Node> node, std::string name) { return boost::shared_ptr<T> (new T (node->node_child (name))); } - + template <class T> boost::shared_ptr<T> optional_type_child (boost::shared_ptr<const cxml::Node> node, std::string name) @@ -74,7 +74,7 @@ type_children (boost::shared_ptr<const cxml::Node> node, std::string name) { return type_children<T> (*node.get(), name); } - + template <class T> std::list<boost::shared_ptr<T> > type_grand_children (cxml::Node const & node, std::string name, std::string sub) @@ -89,7 +89,7 @@ type_grand_children (boost::shared_ptr<const cxml::Node> node, std::string name, { return type_grand_children<T> (*node.get(), name, sub); } - + } #endif diff --git a/test/stl_binary_writer_test.cc b/test/stl_binary_writer_test.cc index f0a407c..f77cba5 100644 --- a/test/stl_binary_writer_test.cc +++ b/test/stl_binary_writer_test.cc @@ -71,7 +71,7 @@ BOOST_AUTO_TEST_CASE (stl_binary_writer_test) l.vertical_position.line = 0; l.vertical_position.lines = 32; l.vertical_position.reference = sub::TOP_OF_SCREEN; - + sub::Block b; b.text = "This is some "; b.font = "Arial"; @@ -114,6 +114,6 @@ BOOST_AUTO_TEST_CASE (stl_binary_writer_test) "Editor contact", "build/test/test.stl" ); - + } diff --git a/test/stl_text_reader_test.cc b/test/stl_text_reader_test.cc index 0ce9594..162790f 100644 --- a/test/stl_text_reader_test.cc +++ b/test/stl_text_reader_test.cc @@ -36,13 +36,13 @@ BOOST_AUTO_TEST_CASE (stl_text_reader_test) list<sub::Subtitle>::iterator i = subs.begin (); - + /* First subtitle */ BOOST_CHECK (i != subs.end ()); BOOST_CHECK_EQUAL (i->from, sub::Time::from_hmsf (0, 0, 41, 9)); BOOST_CHECK_EQUAL (i->to, sub::Time::from_hmsf (0, 0, 42, 21)); - + list<sub::Line>::iterator j = i->lines.begin (); BOOST_CHECK (j != i->lines.end ()); BOOST_CHECK_EQUAL (j->blocks.size(), 1); @@ -68,20 +68,20 @@ BOOST_AUTO_TEST_CASE (stl_text_reader_test) BOOST_CHECK_EQUAL (j->vertical_position.line.get(), 1); ++i; - + /* Second subtitle */ - + BOOST_CHECK (i != subs.end ()); BOOST_CHECK_EQUAL (i->from, sub::Time::from_hmsf (0, 1, 1, 1)); BOOST_CHECK_EQUAL (i->to, sub::Time::from_hmsf (0, 1, 2, 10)); - + BOOST_CHECK_EQUAL (i->lines.size(), 1); sub::Line l = i->lines.front (); BOOST_CHECK_EQUAL (l.blocks.size(), 7); BOOST_CHECK_EQUAL (l.vertical_position.line.get(), 0); list<sub::Block>::iterator k = l.blocks.begin (); - + BOOST_CHECK (k != l.blocks.end ()); BOOST_CHECK_EQUAL (k->text, " This is some "); BOOST_CHECK_EQUAL (k->font.get(), "Arial"); @@ -144,7 +144,7 @@ BOOST_AUTO_TEST_CASE (stl_text_reader_test) BOOST_CHECK_EQUAL (k->italic, false); BOOST_CHECK_EQUAL (k->underline, false); ++k; - + BOOST_CHECK (k == l.blocks.end ()); } diff --git a/test/time_test.cc b/test/time_test.cc index 76f9a7b..a4dae50 100644 --- a/test/time_test.cc +++ b/test/time_test.cc @@ -45,7 +45,7 @@ BOOST_AUTO_TEST_CASE (time_construction_test) BOOST_AUTO_TEST_CASE (time_conversion_test) { sub::Time p; - + /* 40ms = 1 frame at 25fps */ p = sub::Time::from_hms (3, 5, 7, 40); BOOST_CHECK_EQUAL (p.frames_at (sub::Rational (25, 1)), 1); diff --git a/test/vertical_position_test.cc b/test/vertical_position_test.cc index 3204113..c106a27 100644 --- a/test/vertical_position_test.cc +++ b/test/vertical_position_test.cc @@ -27,9 +27,9 @@ BOOST_AUTO_TEST_CASE (vertical_position_test) { sub::VerticalPosition a; sub::VerticalPosition b; - + /* Simple */ - + a.proportional = 0.3; a.reference = sub::TOP_OF_SCREEN; b.proportional = 0.4; @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE (vertical_position_test) BOOST_CHECK (b < a); /* Different line counts with lines */ - + a.proportional = optional<float> (); b.proportional = optional<float> (); |
