示例#1
0
void
GuiAppInstance::addUserKeyframeIndicator(SequenceTime time)
{
    ///runs only in the main thread
    assert( QThread::currentThread() == qApp->thread() );

    _imp->timelineUserKeys.push_back(time);
    Q_EMIT keyframeIndicatorsChanged();
}
示例#2
0
文件: TimeLine.cpp 项目: GDXN/Natron
void
TimeLine::addKeyframeIndicator(SequenceTime time)
{
    ///runs only in the main thread
    assert( QThread::currentThread() == qApp->thread() );

    _keyframes.push_back(time);
    emit keyframeIndicatorsChanged();
}
示例#3
0
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()) );
    }
示例#4
0
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();
    }
}
示例#5
0
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();
    }
}
示例#6
0
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();
    }
}
示例#7
0
文件: TimeLine.cpp 项目: GDXN/Natron
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();
    }
}
示例#8
0
文件: TimeLine.cpp 项目: GDXN/Natron
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();
    }
}
示例#9
0
文件: TimeLine.cpp 项目: GDXN/Natron
void
TimeLine::removeAllKeyframesIndicators()
{
    ///runs only in the main thread
    assert( QThread::currentThread() == qApp->thread() );

    bool wasEmpty = _keyframes.empty();
    _keyframes.clear();
    if (!wasEmpty) {
        emit keyframeIndicatorsChanged();
    }
}
示例#10
0
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();
    }
}
示例#11
0
}

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) );
}