From d0869653a0bdfa010da0b1b00f83ea89f3abbdb1 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 29 Jan 2014 16:42:55 +0000 Subject: Various developments. --- src/subtitle.h | 75 +++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 46 insertions(+), 29 deletions(-) (limited to 'src/subtitle.h') diff --git a/src/subtitle.h b/src/subtitle.h index 3afd0f3..b60b7f7 100644 --- a/src/subtitle.h +++ b/src/subtitle.h @@ -21,6 +21,10 @@ #define LIBSUB_SUBTITLE_H #include "frame_time.h" +#include "metric_time.h" +#include "colour.h" +#include "vertical_reference.h" +#include "effect.h" #include #include @@ -30,46 +34,59 @@ class Subtitle { public: Subtitle () - : font_size (0) + : colour (1, 1, 1) , bold (false) , italic (false) , underline (false) , line (0) {} - Subtitle ( - std::string text, - std::string font, - int font_size, - bool bold, - bool italic, - bool underline, - int line, - FrameTime from, - FrameTime to - ) - : text (text) - , font (font) - , font_size (font_size) - , bold (bold) - , italic (italic) - , underline (underline) - , line (line) - , frame_from (from) - , frame_to (to) - {} - std::string text; std::string font; - int font_size; - bool bold; - bool italic; - bool underline; + + /** font size */ + struct { + /** as a proportion of screen height */ + boost::optional proportional; + /** in points */ + boost::optional points; + } font_size; + + /** vertical position of the baseline of the text */ + struct { + /** as a proportion of screen height offset from some reference point */ + boost::optional proportional; + /** reference position for proportional */ + boost::optional reference; + } vertical_position; + + boost::optional effect; + boost::optional 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 int line; - boost::optional frame_from; - boost::optional frame_to; + + /** from time */ + struct { + boost::optional frame; + boost::optional metric; + } from; + + /** to time */ + struct { + boost::optional frame; + boost::optional metric; + } to; + + boost::optional fade_up; + boost::optional fade_down; }; +bool operator< (Subtitle const & a, Subtitle const & b); + } #endif -- cgit v1.2.3