Fix boost bind warning.
[libsub.git] / src / subtitle.h
index 390631449b811105e245d4fd370338f3ab624400..fba0cf40543b75079e7e71235f216503c65b5acd 100644 (file)
 #include "effect.h"
 #include "font_size.h"
 #include "vertical_position.h"
+#include "horizontal_position.h"
 #include "raw_subtitle.h"
 #include <boost/optional.hpp>
 #include <string>
-#include <list>
+#include <vector>
 
 namespace sub {
 
@@ -49,7 +50,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,13 +60,15 @@ 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
        bool underline; ///< true to underline
 };
 
+extern bool operator== (Block const & a, Block const & b);
+
 /** @class Line
  *  @brief A line of text within a subtitle.
  *
@@ -74,19 +77,26 @@ public:
 class Line
 {
 public:
-       Line () {}
-       
+       Line ()
+       {
+               horizontal_position.reference = HORIZONTAL_CENTRE_OF_SCREEN;
+       }
+
        /** Construct a Line taking any relevant information from a RawSubtitle */
        Line (RawSubtitle s);
 
+       HorizontalPosition horizontal_position;
+
        /** vertical position of the baseline of the text */
        VerticalPosition vertical_position;
 
-       std::list<Block> blocks;
+       std::vector<Block> blocks;
 
        bool same_metadata (RawSubtitle) const;
 };
 
+extern bool operator== (Line const & a, Line const & b);
+
 /** @class Subtitle
  *  @brief A subtitle which has been collected into lines and blocks.
  *
@@ -101,20 +111,22 @@ 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;
 
-       std::list<Line> lines;
+       std::vector<Line> lines;
 
        bool same_metadata (RawSubtitle) const;
 };
 
+extern bool operator== (Subtitle const & a, Subtitle const & b);
+
 }
 
 #endif