Header guard.
[libsub.git] / src / frame_time.h
index 1a97e63a63872947057f454a98b209269619cc7a..ed5fc8170cf0bfa69491938bdcca2a11328f73c3 100644 (file)
@@ -21,6 +21,7 @@
 #define LIBSUB_FRAME_TIME_H
 
 #include <iostream>
+#include <stdint.h>
 
 namespace sub {
 
@@ -36,6 +37,11 @@ public:
                , _seconds (0)
                , _frames (0)
        {}
+
+       /** @param f Number of frames.
+        *  @param fps Frames per second.
+        */
+       FrameTime (int64_t f, float fps);
                          
        FrameTime (int h, int m, int s, int f)
                : _hours (h)
@@ -62,10 +68,11 @@ public:
 
        std::string timecode () const;
 
+       void add (FrameTime t, float fps);
+       void scale (float f, float fps);
+
 private:
-       friend bool operator== (FrameTime const & a, FrameTime const & b);
-       friend bool operator< (FrameTime const & a, FrameTime const & b);
-       friend std::ostream& operator<< (std::ostream& s, FrameTime const & t);
+       void set_from_frames (int64_t f, float fps);
        
        int _hours;
        int _minutes;