#define LIBSUB_FRAME_TIME_H
#include <iostream>
+#include <stdint.h>
namespace sub {
, _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)
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;