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;
30 m_timer.setSingleShot(
true);
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);
60 if (m_timer.isActive()) {
67void AnimatedUpdateTrack::seek(
double offset)
73 if (offset <= m_delayBeforeTrackStarts) {
75 m_pauseTime = QDateTime();
77 m_timer.start((m_delayBeforeTrackStarts - m_progress) * 1000);
84 m_pauseTime = QDateTime();
85 m_item->seek(offset - m_delayBeforeTrackStarts);
89 m_item->seek(offset - m_delayBeforeTrackStarts);
94void AnimatedUpdateTrack::stop()
99 m_playTime = QDateTime();
100 m_pauseTime = QDateTime();
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()
QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor)