-/** Returns the time in frames, after being given the number of frames per second */
-double GenTime::frames(double framesPerSecond) const {
- return (int) floor(m_time * framesPerSecond + 0.5);
+double GenTime::frames(double framesPerSecond) const
+{
+ return floor(m_time * framesPerSecond + 0.5);
+}
+
+GenTime& GenTime::roundNearestFrame(double framesPerSecond)
+{
+ m_time = floor((m_time * framesPerSecond) + 0.5) / framesPerSecond;
+ return *this;