No-op: whitespace.
[libdcp.git] / src / subtitle_string.h
index 512a1b5b3829fb2219fb569771f893175ad2d5f5..2dfdbe0a04b20358ffb1048493df748917e84487 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
@@ -40,15 +40,18 @@ public:
        SubtitleString (
                boost::optional<std::string> font,
                bool italic,
-               Color color,
+               Colour colour,
                int size,
+               float aspect_adjust,
                Time in,
                Time out,
+               float h_position,
+               HAlign h_align,
                float v_position,
                VAlign v_align,
                std::string text,
                Effect effect,
-               Color effect_color,
+               Colour effect_colour,
                Time fade_up_time,
                Time fade_down_time
                );
@@ -62,8 +65,8 @@ public:
                return _italic;
        }
 
-       Color color () const {
-               return _color;
+       Colour colour () const {
+               return _colour;
        }
 
        Time in () const {
@@ -78,6 +81,14 @@ public:
                return _text;
        }
 
+       float h_position () const {
+               return _h_position;
+       }
+
+       HAlign h_align () const {
+               return _h_align;
+       }
+
        /** @return vertical position as a proportion of the screen height from the top
         *  (between 0 and 1)
         */
@@ -93,8 +104,8 @@ public:
                return _effect;
        }
 
-       Color effect_color () const {
-               return _effect_color;
+       Colour effect_colour () const {
+               return _effect_colour;
        }
 
        Time fade_up_time () const {
@@ -108,9 +119,21 @@ public:
        int size () const {
                return _size;
        }
-       
+
        int size_in_pixels (int screen_height) const;
 
+       /** @return Aspect ratio `adjustment' of the font size.
+        *  Values greater than 1 widen each character, values less than 1 narrow each character,
+        *  and the value must be between 0.25 and 4.
+        */
+       float aspect_adjust () const {
+               return _aspect_adjust;
+       }
+
+       void set_h_position (float p) {
+               _h_position = p;
+       }
+
        /** @param p New vertical position as a proportion of the screen height
         *  from the top (between 0 and 1)
         */
@@ -122,27 +145,37 @@ public:
                _size = s;
        }
 
+       void set_aspect_adjust (float a) {
+               _aspect_adjust = a;
+       }
+
 private:
        /** font ID */
        boost::optional<std::string> _font;
        /** true if the text is italic */
        bool _italic;
        /** text colour */
-       Color _color;
+       Colour _colour;
        /** 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;
+       float _aspect_adjust;
        Time _in;
        Time _out;
-       /** Vertical position as a proportion of the screen height from the top
+       /** Horizontal position as a proportion of the screen width from the _h_align
+        *  (between 0 and 1)
+        */
+       float _h_position;
+       HAlign _h_align;
+       /** Vertical position as a proportion of the screen height from the _v_align
         *  (between 0 and 1)
         */
        float _v_position;
        VAlign _v_align;
        std::string _text;
        Effect _effect;
-       Color _effect_color;
+       Colour _effect_colour;
        Time _fade_up_time;
        Time _fade_down_time;
 };