Add a couple of accessors.
[libdcp.git] / src / types.h
index ece7d44c284bb547ee18764103947b887c7d8aa0..040e6197f01f2355040a321ce90f48e8fbd81e19 100644 (file)
@@ -101,6 +101,10 @@ public:
         */
        Fraction (int n, int d) : numerator (n), denominator (d) {}
 
+       float as_float () const {
+               return float (numerator) / denominator;
+       }
+
        int numerator;
        int denominator;
 };
@@ -137,13 +141,13 @@ struct EqualityOptions
        bool mxf_names_can_differ;
 };
 
-/* Win32 defines this */       
-#undef ERROR
-
+/* I've been unable to make mingw happy with ERROR as a symbol, so
+   I'm using a DCP_ prefix here.
+*/
 enum NoteType {
-       PROGRESS,
-       ERROR,
-       NOTE
+       DCP_PROGRESS,
+       DCP_ERROR,
+       DCP_NOTE
 };
 
 enum Standard {
@@ -151,6 +155,12 @@ enum Standard {
        SMPTE
 };
 
+enum Formulation {
+       MODIFIED_TRANSITIONAL_1,
+       DCI_ANY,
+       DCI_SPECIFIC
+};
+
 /** @class Color
  *  @brief An RGB color (aka colour).
  */