void GuiAppInstance::addUserKeyframeIndicator(SequenceTime time) { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); _imp->timelineUserKeys.push_back(time); Q_EMIT keyframeIndicatorsChanged(); }
void TimeLine::addKeyframeIndicator(SequenceTime time) { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); _keyframes.push_back(time); emit keyframeIndicatorsChanged(); }
void TimeLineGui::setTimeline(const boost::shared_ptr<TimeLine>& timeline) { if (_imp->timeline) { //connect the internal timeline to the gui QObject::disconnect( _imp->timeline.get(), SIGNAL(frameChanged(SequenceTime,int)), this, SLOT(onFrameChanged(SequenceTime,int)) ); //connect the gui to the internal timeline QObject::disconnect( _imp->gui->getApp(), SIGNAL(keyframeIndicatorsChanged()), this, SLOT(onKeyframesIndicatorsChanged()) ); }
void GuiAppInstance::removeUserKeyFrameIndicator(SequenceTime time) { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); std::list<SequenceTime>::iterator it = std::find(_imp->timelineUserKeys.begin(), _imp->timelineUserKeys.end(), time); if ( it != _imp->timelineUserKeys.end() ) { _imp->timelineUserKeys.erase(it); Q_EMIT keyframeIndicatorsChanged(); } }
void GuiAppInstance::addUserMultipleKeyframeIndicatorsAdded(const std::list<SequenceTime> & keys, bool emitSignal) { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); _imp->timelineUserKeys.insert( _imp->timelineUserKeys.begin(), keys.begin(), keys.end() ); if (!keys.empty() && emitSignal) { Q_EMIT keyframeIndicatorsChanged(); } }
void GuiAppInstance::removeAllUserKeyframesIndicators() { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); bool wasEmpty = _imp->timelineUserKeys.empty(); _imp->timelineUserKeys.clear(); if (!wasEmpty) { Q_EMIT keyframeIndicatorsChanged(); } }
void TimeLine::removeKeyFrameIndicator(SequenceTime time) { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); std::list<SequenceTime>::iterator it = std::find(_keyframes.begin(), _keyframes.end(), time); if ( it != _keyframes.end() ) { _keyframes.erase(it); emit keyframeIndicatorsChanged(); } }
void TimeLine::addMultipleKeyframeIndicatorsAdded(const std::list<SequenceTime> & keys, bool emitSignal) { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); _keyframes.insert( _keyframes.begin(),keys.begin(),keys.end() ); if (!keys.empty() && emitSignal) { emit keyframeIndicatorsChanged(); } }
void TimeLine::removeAllKeyframesIndicators() { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); bool wasEmpty = _keyframes.empty(); _keyframes.clear(); if (!wasEmpty) { emit keyframeIndicatorsChanged(); } }
void GuiAppInstance::removeUserMultipleKeyframeIndicator(const std::list<SequenceTime> & keys, bool emitSignal) { ///runs only in the main thread assert( QThread::currentThread() == qApp->thread() ); for (std::list<SequenceTime>::const_iterator it = keys.begin(); it != keys.end(); ++it) { std::list<SequenceTime>::iterator it2 = std::find(_imp->timelineUserKeys.begin(), _imp->timelineUserKeys.end(), *it); if ( it2 != _imp->timelineUserKeys.end() ) { _imp->timelineUserKeys.erase(it2); } } if (!keys.empty() && emitSignal) { Q_EMIT keyframeIndicatorsChanged(); } }
} void TimeLineGui::setTimeline(const boost::shared_ptr<TimeLine>& timeline) { if (_imp->timeline) { //connect the internal timeline to the gui QObject::disconnect( _imp->timeline.get(), SIGNAL(frameChanged(SequenceTime,int)), this, SLOT(onFrameChanged(SequenceTime,int)) ); //connect the gui to the internal timeline QObject::disconnect( _imp->gui->getApp(), SIGNAL(keyframeIndicatorsChanged()), this, SLOT(onKeyframesIndicatorsChanged()) ); } //connect the internal timeline to the gui QObject::connect( timeline.get(), SIGNAL(frameChanged(SequenceTime,int)), this, SLOT(onFrameChanged(SequenceTime,int)), Qt::UniqueConnection ); QObject::connect( _imp->gui->getApp(), SIGNAL(keyframeIndicatorsChanged()), this, SLOT(onKeyframesIndicatorsChanged()), Qt::UniqueConnection ); _imp->timeline = timeline; } boost::shared_ptr<TimeLine> TimeLineGui::getTimeline() const { return _imp->timeline; } QSize TimeLineGui::sizeHint() const { return QSize( TO_DPIX(1000), TO_DPIY(45) ); }