No-op; remove trailing whitespace.
authorCarl Hetherington <cth@carlh.net>
Wed, 16 Dec 2015 20:35:54 +0000 (20:35 +0000)
committerCarl Hetherington <cth@carlh.net>
Wed, 16 Dec 2015 20:35:54 +0000 (20:35 +0000)
21 files changed:
src/dcp_reader.h
src/font_size.h
src/raw_subtitle.h
src/reader.h
src/reader_factory.cc
src/smpte_dcp_reader.cc
src/stl_binary_tables.cc
src/stl_binary_tables.h
src/stl_binary_writer.cc
src/sub_time.h
src/subtitle.cc
src/subtitle.h
src/vertical_position.cc
src/vertical_position.h
src/vertical_reference.cc
src/vertical_reference.h
src/xml.h
test/stl_binary_writer_test.cc
test/stl_text_reader_test.cc
test/time_test.cc
test/vertical_position_test.cc

index f749f82981b2881e292ac37c39396577b825d99b..82a211c0ba53f4c06d20505343a5d4e14e456266 100644 (file)
@@ -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;
 };
index 6f4f8a52ace530b18c361436bf8029af3fe0a2c1..6439c8f7d114a44297491062ff672e56ecb00ceb 100644 (file)
@@ -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;
-       
+
 };
 
 }
index a27329a705c23fc3a4cdeaa55afcffe866d02e42..2a202c1430b42d9226a7e0efb3e01109694c5636 100644 (file)
@@ -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 &);
 
 }
 
index 091df61161851ed6fb9f28df68290db4f71f558f..08474f64d0a42201ba09816a70817603c635b613 100644 (file)
@@ -36,7 +36,7 @@ class Reader
 {
 public:
        virtual ~Reader () {}
-       
+
        std::list<RawSubtitle> subtitles () const {
                return _subs;
        }
index 05634c0f5befffb3a022d6b3301f352938d668cb..6c0259d94edb72224f4709908826eff5347407ba 100644 (file)
@@ -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));
index 6014196fd79f7460b6150f356344a8fab47fd16e..606d9e52118125b3164de9bd51ac0ed2086223d9 100644 (file)
@@ -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"));
index 9aaf4b8cd34933ce900dfaa27a50c8269950219c..f84342151ea3383eda12d9210e43384e9b765b77 100644 (file)
@@ -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");
index adaae8270103c537115d3dad7f5587343720b7c1..4a6a7d86d6afa5ee236c7a0f51c7640ff58d9ee4 100644 (file)
@@ -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;
index 43b0adffdcaef27c7643ea9212a21808c864376d..b9bd7e01783c5c1894c6cabf9a865adde88f4c52 100644 (file)
@@ -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);
 
index 22178e9c03dbc06165f321ef33c1e0d5dea3bbf6..7abdedbe23ec26918a67a626f120cb1c358ffa44 100644 (file)
@@ -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
index d8286288f2c64e837c4f3222927882e923d864ce..663c16185da051659c2f62597b5eceed59c969bd 100644 (file)
@@ -59,5 +59,5 @@ Block::Block (RawSubtitle s)
        , italic (s.italic)
        , underline (s.underline)
 {
-       
+
 }
index 390631449b811105e245d4fd370338f3ab624400..2d22dac651bf1965200df7114caeb3356aa7edee 100644 (file)
@@ -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;
 
index 5f7d0d085325c243babc9f912b725479d09e8959..9801e4d53237be6c9c99aa70d758adbe19e9d504 100644 (file)
@@ -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;
index 9f04056b3d17b7da1c4d7ef24e6c02a29fd8b0dc..7bc057ee132f7d0b76404b488f185a746684865c 100644 (file)
@@ -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
index 3f9219badae0a903bd16b454b360b1a32ff01c78..7dff96515379ef3e6a67f3948ac2b4db18a0d873 100644 (file)
@@ -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");
 }
index 4bdcde85e3390df06903cc59a691a859db74f9e3..8f5d89916d55f8aa4c2cae11b7e996c9ac32aafa 100644 (file)
@@ -33,7 +33,7 @@ enum VerticalReference
 };
 
 VerticalReference string_to_vertical_reference (std::string s);
-       
+
 }
 
 #endif
index d62dbd6db8ff9ddc579ac2e727907053edf1b276..d07188fd448a9273ff24b3a509e03e7383276f2a 100644 (file)
--- a/src/xml.h
+++ b/src/xml.h
@@ -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
index f0a407c851d948af8eed71c21e4eb0a42c472b93..f77cba5d3d8afa894ed27604c631cf57bed83ab9 100644 (file)
@@ -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"
                );
-               
+
 }
 
index 0ce9594b113e84c6133464bb25150f0384601c06..162790fa23cf0398b3f04a30a24490c7e4ce580e 100644 (file)
@@ -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 ());
 }
 
index 76f9a7b89872b420ffe58a417c4468984e7dd0fc..a4dae507237aa436a3e9f1643bc4d45080ed01f0 100644 (file)
@@ -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);
index 3204113afb81b820462e2f21211086719554d7bd..c106a27aa5d2757e219dd8cef7a450e3cc590332 100644 (file)
@@ -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> ();