More header guards.
[libsub.git] / src / frame_time.cc
index da9973cc0904e80e26fec463da6dd8a28aad23dd..65996c090742082d25a48700a64b961a3dbef59c 100644 (file)
@@ -63,6 +63,12 @@ FrameTime::timecode () const
 }
 
 FrameTime::FrameTime (int64_t f, float fps)
+{
+       set_from_frames (f, fps);
+}
+
+void
+FrameTime::set_from_frames (int64_t f, float fps)
 {
        _hours = f / (60 * 60 * fps);
        f -= _hours * 60 * 60 * fps;
@@ -96,3 +102,12 @@ FrameTime::add (FrameTime t, float fps)
 
        _hours += t.hours ();
 }
+
+void
+FrameTime::scale (float f, float frames_per_second)
+{
+       set_from_frames (
+               (((_hours * 3600 + _minutes * 60 + _seconds) * frames_per_second) + _frames) * f,
+               frames_per_second
+               );
+}