summaryrefslogtreecommitdiff
path: root/src/types.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-06-03 23:32:48 +0100
committerCarl Hetherington <cth@carlh.net>2015-06-03 23:32:48 +0100
commite1f53890da6e4be2555a9e17a52edcc03d53656b (patch)
treeff148f4d8dc54b1a09fa21ca743fce261f01c021 /src/types.h
parent47b52fb54f302d5faf93a19ae2fe28fa610f96ca (diff)
Basic HAlign / HPosition support.
Diffstat (limited to 'src/types.h')
-rw-r--r--src/types.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/types.h b/src/types.h
index 52b831f7..a8e63faf 100644
--- a/src/types.h
+++ b/src/types.h
@@ -94,11 +94,21 @@ enum Effect
extern std::string effect_to_string (Effect e);
extern Effect string_to_effect (std::string s);
+enum HAlign
+{
+ HALIGN_LEFT, ///< horizontal position is distance from left of screen to left of subtitle
+ HALIGN_CENTER, ///< horizontal position is distance from centre of screen to centre of subtitle
+ HALIGN_RIGHT, ///< horizontal position is distance from right of screen to right of subtitle
+};
+
+extern std::string halign_to_string (HAlign a);
+extern HAlign string_to_halign (std::string s);
+
enum VAlign
{
- TOP,
- CENTER,
- BOTTOM
+ VALIGN_TOP, ///< vertical position is distance from top of screen to top of subtitle
+ VALIGN_CENTER, ///< vertical position is distance from centre of screen to centre of subtitle
+ VALIGN_BOTTOM ///< vertical position is distance from bottom of screen to bottom of subtitle
};
extern std::string valign_to_string (VAlign a);
@@ -217,7 +227,12 @@ typedef boost::function<void (NoteType, std::string)> NoteHandler;
/** Maximum absolute difference between dcp::SubtitleString::aspect_adjust values that
* are considered equal.
*/
-#define ASPECT_ADJUST_EPSILON (1e-3)
+const float ASPECT_ADJUST_EPSILON = 1e-3;
+
+/** Maximum absolute difference between dcp::SubtitleString alignment values that
+ * are considered equal.
+ */
+const float ALIGN_EPSILON = 1e-3;
}