bool SmallRuler::slotNewValue(int value)
{
+ if (value == m_cursorFramePosition) return false;
m_cursorFramePosition = value;
int oldPos = m_cursorPosition;
m_cursorPosition = value * m_scale;
- if (oldPos == m_cursorPosition) return false;
const int offset = 6;
const int x = qMin(oldPos, m_cursorPosition);
const int w = qAbs(oldPos - m_cursorPosition);
QString Timecode::getStringTimecode(int frames, const double &fps)
{
// Returns the timecode in an hh:mm:ss format
- int seconds = frames / (int) floor(fps + 0.5);
+ int seconds = (int) (frames / fps);
int minutes = seconds / 60;
seconds = seconds % 60;
int hours = minutes / 60;
QString Timecode::getEasyTimecode(const GenTime & time, const double &fps)
{
// Returns the timecode in an easily read display, like 3 min. 5 sec.
- int frames = (int)time.frames(fps);
- int seconds = frames / (int) floor(fps + 0.5);
- frames = frames % ((int) fps);
+ int frames = (int) time.frames(fps);
+ int seconds = (int) (frames / fps);
+ frames = frames - ((int) (fps * seconds));
int minutes = seconds / 60;
seconds = seconds % 60;