work towards shifting functions from timelineview to timelinewidget

This commit is contained in:
itsmattkc
2019-10-11 16:57:12 +11:00
parent 79d1f99fa8
commit e9f5d0d248
34 changed files with 895 additions and 704 deletions
@@ -6,7 +6,32 @@ TimelineScaledObject::TimelineScaledObject() :
}
double TimelineScaledObject::TimeToScreenCoord(const rational &time)
const rational &TimelineScaledObject::timebase()
{
return timebase_;
}
const double &TimelineScaledObject::timebase_dbl()
{
return timebase_dbl_;
}
double TimelineScaledObject::TimeToScene(const rational &time)
{
return time.toDouble() * scale_;
}
rational TimelineScaledObject::SceneToTime(const double &x)
{
// Adjust screen point by scale and timebase
qint64 scaled_x_mvmt = qRound64(x / scale_ / timebase_dbl_);
// Return a time in the timebase
return rational(scaled_x_mvmt * timebase_.numerator(), timebase_.denominator());
}
void TimelineScaledObject::SetTimebaseInternal(const rational &timebase)
{
timebase_ = timebase;
timebase_dbl_ = timebase_.toDouble();
}