24 mStartTime = QDateTime::currentDateTime();
30 connect(mTimer, SIGNAL(timeout()),
this, SLOT(timeoutSlot()));
31 mTimer->setInterval(40);
52 return mTimer->isActive();
57 mPlayStart = QDateTime::currentDateTime();
58 mLastPlayOffset = mOffset;
80 if (mTimer->isActive())
83 qint64 offset = mPlayStart.msecsTo(QDateTime::currentDateTime());
84 return mLastPlayOffset + mSpeed * offset;
92 void PlaybackTime::timeoutSlot()
149 mPlaying = mBase->isPlaying();
169 mOffset = std::max<quint64>(0, val);
196 mTimer->setInterval(val);
201 return mTimer->interval();
218 double w = mEndTime - mStartTime;
219 double m = mStartTime + w/2;
220 return fabs(time - m) < std::max(w, tol_ms)/2;
225 double w0 = mEndTime - mStartTime;
226 double m0 = mStartTime + w0/2;
229 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)
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)
bool similar(const CameraInfo &lhs, const CameraInfo &rhs, double tol)
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)
Namespace for all CustusX production code.