Rename ReelMXF -> ReelFileAsset.
[libdcp.git] / src / subtitle.h
index 32f7457a650bc688408d6a9d570063a8ac038f00..e0132dbe8a99152792a4d5fd739b14cd6dc45559 100644 (file)
     files in the program, then also delete it here.
 */
 
+
 /** @file  src/subtitle.h
- *  @brief Subtitle class.
+ *  @brief Subtitle class
  */
 
+
+#ifndef LIBDCP_SUBTITLE_H
+#define LIBDCP_SUBTITLE_H
+
+
 #include "dcp_time.h"
 
+
 namespace dcp {
 
+
 class Subtitle
 {
 public:
-       Subtitle (
-               Time in,
-               Time out,
-               float h_position,
-               HAlign h_align,
-               float v_position,
-               VAlign v_align,
-               Time fade_up_time,
-               Time fade_down_time
-               );
+       virtual ~Subtitle () {}
 
+       /** @return subtitle start time (relative to the start of the reel) */
        Time in () const {
                return _in;
        }
 
+       /** @return subtitle finish time (relative to the start of the reel) */
        Time out () const {
                return _out;
        }
 
-
        float h_position () const {
                return _h_position;
        }
@@ -109,30 +109,46 @@ public:
                _v_position = p;
        }
 
-       void set_fade_up_time (dcp::Time t) {
+       void set_fade_up_time (Time t) {
                _fade_up_time = t;
        }
 
-       void set_fade_down_time (dcp::Time t) {
+       void set_fade_down_time (Time t) {
                _fade_down_time = t;
        }
 
 
 protected:
+
+       Subtitle (
+               Time in,
+               Time out,
+               float h_position,
+               HAlign h_align,
+               float v_position,
+               VAlign v_align,
+               Time fade_up_time,
+               Time fade_down_time
+               );
+
        Time _in;
        Time _out;
        /** Horizontal position as a proportion of the screen width from the _h_align
         *  (between 0 and 1)
         */
-       float _h_position;
-       HAlign _h_align;
+       float _h_position = 0;
+       HAlign _h_align = HAlign::CENTER;
        /** Vertical position as a proportion of the screen height from the _v_align
         *  (between 0 and 1)
         */
-       float _v_position;
-       VAlign _v_align;
+       float _v_position = 0;
+       VAlign _v_align = VAlign::CENTER;
        Time _fade_up_time;
        Time _fade_down_time;
 };
 
+
 }
+
+
+#endif