- Time fade_down_time () const {
- return _fade_down_time;
- }
-
- int size () const {
- return _size;
- }
-
- int size_in_pixels (int screen_height) const;
-
-private:
- std::string _font;
- bool _italic;
- Color _color;
- /** Size in points as if the screen height is 11 inches, so a 72pt font
- * would be 1/11th of the screen height.
- */
- int _size;
- Time _in;
- Time _out;
- /** Vertical position as a proportion of the screen height from the top
- * (between 0 and 1)
- */
- float _v_position;
- VAlign _v_align;
- std::string _text;
- Effect _effect;
- Color _effect_color;
- Time _fade_up_time;
- Time _fade_down_time;
-};
-
-bool operator== (Subtitle const & a, Subtitle const & b);
-std::ostream& operator<< (std::ostream& s, Subtitle const & sub);
+ struct ParseState {
+ boost::optional<std::string> font_id;
+ boost::optional<int64_t> size;
+ boost::optional<float> aspect_adjust;
+ boost::optional<bool> italic;
+ boost::optional<bool> bold;
+ boost::optional<bool> underline;
+ boost::optional<Colour> colour;
+ boost::optional<Effect> effect;
+ boost::optional<Colour> effect_colour;
+ boost::optional<float> h_position;
+ boost::optional<HAlign> h_align;
+ boost::optional<float> v_position;
+ boost::optional<VAlign> v_align;
+ boost::optional<Direction> direction;
+ boost::optional<Time> in;
+ boost::optional<Time> out;
+ boost::optional<Time> fade_up_time;
+ boost::optional<Time> fade_down_time;
+ enum Type {
+ TEXT,
+ IMAGE
+ };
+ boost::optional<Type> type;
+ };