6#include "AnimatedUpdateTrack.h"
8#include "PlaybackAnimatedUpdateItem.h"
13AnimatedUpdateTrack::AnimatedUpdateTrack(PlaybackAnimatedUpdateItem *item)
17 m_delayBeforeTrackStarts = 0;
20 connect(m_item, &PlaybackItem::balloonHidden,
this, &AnimatedUpdateTrack::balloonHidden);
21 connect(m_item, &PlaybackItem::balloonShown,
this, &AnimatedUpdateTrack::balloonShown);
22 connect(m_item, &PlaybackItem::updated,
this, &AnimatedUpdateTrack::updated);
23 connect(m_item, &PlaybackItem::added,
this, &AnimatedUpdateTrack::added);
24 connect(m_item, &PlaybackItem::removed,
this, &AnimatedUpdateTrack::removed);
27void AnimatedUpdateTrack::setDelayBeforeTrackStarts(
double delay)
29 m_delayBeforeTrackStarts = delay;
31 m_timer.
setInterval(m_delayBeforeTrackStarts * 1000);
34double AnimatedUpdateTrack::delayBeforeTrackStarts()
const
36 return m_delayBeforeTrackStarts;
39void AnimatedUpdateTrack::play()
43 if (m_progress <= m_delayBeforeTrackStarts) {
44 m_timer.
start((m_delayBeforeTrackStarts - m_progress) * 1000);
50void AnimatedUpdateTrack::playSlot()
55void AnimatedUpdateTrack::pause()
59 m_progress += m_playTime.
secsTo(m_pauseTime);
67void AnimatedUpdateTrack::seek(
double offset)
73 if (offset <= m_delayBeforeTrackStarts) {
77 m_timer.
start((m_delayBeforeTrackStarts - m_progress) * 1000);
85 m_item->seek(offset - m_delayBeforeTrackStarts);
89 m_item->seek(offset - m_delayBeforeTrackStarts);
94void AnimatedUpdateTrack::stop()
104void AnimatedUpdateTrack::setPaused(
bool pause)
111#include "moc_AnimatedUpdateTrack.cpp"
Q_SCRIPTABLE Q_NOREPLY void pause()
Binds a QML item to a specific geodetic location in screen coordinates.
QDateTime addMSecs(qint64 msecs) const const
QDateTime currentDateTime()
qint64 secsTo(const QDateTime &other) const const
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)
void setInterval(int msec)
bool isActive() const const
void setSingleShot(bool singleShot)