diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2017-01-23 08:57:04 +0000 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2017-01-27 12:34:49 +0000 |
commit | 0070276340e15872362858928d6858ae31e07f7e (patch) | |
tree | d1e13ef663ca26d2e6856755e36ea8b70c4b3401 /src/animation/backend/handler.cpp | |
parent | eda313e0855f94e317cd656ad9c83ef086e17625 (diff) |
Add running property to QClipAnimator
Change-Id: I5ef29ada7fd6584674d98162f7106177e199b720
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/animation/backend/handler.cpp')
-rw-r--r-- | src/animation/backend/handler.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp index 0da9ba4dd..da0df67d1 100644 --- a/src/animation/backend/handler.cpp +++ b/src/animation/backend/handler.cpp @@ -69,6 +69,28 @@ void Handler::setDirty(DirtyFlag flag, Qt3DCore::QNodeId nodeId) } } +void Handler::setClipAnimatorRunning(Qt3DCore::QNodeId clipAnimatorId, bool running) +{ + const auto handle = m_clipAnimatorManager->lookupHandle(clipAnimatorId); + if (handle.isNull()) + return; + + // Add clip to running set if not already present + if (running && !m_runningClipAnimators.contains(handle)) + m_runningClipAnimators.push_back(handle); + + // If being marked as not running, remove from set of running clips + if (!running) { + const auto it = std::find_if(m_runningClipAnimators.begin(), + m_runningClipAnimators.end(), + [handle](const HClipAnimator &h) { return h == handle; }); + if (it != m_runningClipAnimators.end()) + m_runningClipAnimators.erase(it); + } + + qCDebug(HandlerLogic) << "Running clips:" << m_runningClipAnimators; +} + QVector<Qt3DCore::QAspectJobPtr> Handler::jobsToExecute(qint64 time) { Q_UNUSED(time); |