45 mStartTime = QDateTime::currentDateTime();
51 connect(mTimer, SIGNAL(timeout()),
this, SLOT(timeoutSlot()));
52 mTimer->setInterval(40);
73 return mTimer->isActive();
78 mPlayStart = QDateTime::currentDateTime();
79 mLastPlayOffset = mOffset;
101 if (mTimer->isActive())
104 qint64 offset = mPlayStart.msecsTo(QDateTime::currentDateTime());
105 return mLastPlayOffset + mSpeed * offset;
113 void PlaybackTime::timeoutSlot()
190 mOffset = std::max<quint64>(0, val);
217 mTimer->setInterval(val);
222 return mTimer->interval();
240 double m = mStartTime + w/2;
241 return fabs(time - m) < std::max(w, tol_ms)/2;
247 double m0 = mStartTime + w0/2;
250 return fabs(m1-m0) < (w1+w0)/2;
bool isInside(double time, double tol_ms=0) const
void stop()
stop playing and reset to start
bool operator<(const TimelineEvent &rhs) const
bool isOverlap(const TimelineEvent &rhs) const
TemporaryPausePlay(PlaybackTime *base)
void pause()
pause playing
Description of one event in time.
void setSpeed(double val)
set speed as a ratio of real time. 1 is real time, less is slower, more is faster.
void forward(qint64 msecs)
jump forward in ms
QDateTime getTime() const
void setOffset(qint64 val)
set time as an offset from start
void setResolution(qint64 val)
set resolution in ms (signals are emitted with this spacing)
bool similar(const DoubleBoundingBox3D &a, const DoubleBoundingBox3D &b, double tol)
void rewind(qint64 msecs)
jump backward in ms
QDateTime getStartTime() const
void moveOffset(qint64 delta)
change the offset with an amount
void setTime(QDateTime time)
qint64 getLength() const
length of recording in ms
RealScalar length() const
void start()
start playing.
Controller for historic time, playback etc.
void initialize(QDateTime start, qint64 length)