Example #1
0
void gsProcess::setLoopCount(int loopCount)
{
	if (m_process)
		m_process->setLoopCount(loopCount);
	else
		setLoopCount(loopCount);
}
PixmapAnimator::PixmapAnimator( QWidget *parent, QList<QString> frames )
    : QAbstractAnimation( parent ), current_frame( 0 )
{
    foreach( QString name, frames )
        pixmaps.append( new QPixmap( name ) );
    currentPixmap = pixmaps.at( 0 );
    setFps( frames.count() ); /* default to 1 sec loop */
    setLoopCount( -1 );
}
int QTimeLine::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 10)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 10;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< int*>(_v) = duration(); break;
        case 1: *reinterpret_cast< int*>(_v) = updateInterval(); break;
        case 2: *reinterpret_cast< int*>(_v) = currentTime(); break;
        case 3: *reinterpret_cast< Direction*>(_v) = direction(); break;
        case 4: *reinterpret_cast< int*>(_v) = loopCount(); break;
        case 5: *reinterpret_cast< CurveShape*>(_v) = curveShape(); break;
        case 6: *reinterpret_cast< QEasingCurve*>(_v) = easingCurve(); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setDuration(*reinterpret_cast< int*>(_v)); break;
        case 1: setUpdateInterval(*reinterpret_cast< int*>(_v)); break;
        case 2: setCurrentTime(*reinterpret_cast< int*>(_v)); break;
        case 3: setDirection(*reinterpret_cast< Direction*>(_v)); break;
        case 4: setLoopCount(*reinterpret_cast< int*>(_v)); break;
        case 5: setCurveShape(*reinterpret_cast< CurveShape*>(_v)); break;
        case 6: setEasingCurve(*reinterpret_cast< QEasingCurve*>(_v)); break;
        }
        _id -= 7;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 7;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 7;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Example #4
0
void MythUIAnimation::CopyFrom(const MythUIAnimation* animation)
{
    m_type = animation->m_type;
    m_value = animation->m_value;
    m_trigger = animation->m_trigger;
    m_looped = animation->m_looped;
    m_reversible = animation->m_reversible;
    m_centre = animation->m_centre;

    setStartValue(animation->startValue());
    setEndValue(animation->endValue());
    setEasingCurve(animation->easingCurve());
    setDuration(animation->duration());
    if (m_looped)
        setLoopCount(-1);
}
int QAbstractAnimation::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 11)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 11;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< State*>(_v) = state(); break;
        case 1: *reinterpret_cast< int*>(_v) = loopCount(); break;
        case 2: *reinterpret_cast< int*>(_v) = currentTime(); break;
        case 3: *reinterpret_cast< int*>(_v) = currentLoop(); break;
        case 4: *reinterpret_cast< Direction*>(_v) = direction(); break;
        case 5: *reinterpret_cast< int*>(_v) = duration(); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 1: setLoopCount(*reinterpret_cast< int*>(_v)); break;
        case 2: setCurrentTime(*reinterpret_cast< int*>(_v)); break;
        case 4: setDirection(*reinterpret_cast< Direction*>(_v)); break;
        }
        _id -= 6;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 6;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 6;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}
Example #6
0
void Light::startAnimation(AnimationType animation, int duration) {
	m_currentAnimationDuration = duration;
	m_currentAnimation = animation;

	if (m_currentAnimationDuration <= 0 || m_currentAnimation == NoAnimation ) {
		
		m_step = 1;
		updateCurrentTime(1);
		stop();
		return;
	}
	else {	
	  setLoopCount(-1);
	  m_step = 1/(qreal)m_currentAnimationDuration;
	  qDebug() << " startAnimation m_step =" << m_step ;	  
	   start();
	}
	
}
QT_BEGIN_NAMESPACE

QQuickAnimatorProxyJob::QQuickAnimatorProxyJob(QAbstractAnimationJob *job, QObject *item)
    : m_controller(0)
    , m_job(job)
    , m_internalState(State_Stopped)
    , m_jobManagedByController(false)
{
    m_isRenderThreadProxy = true;
    m_animation = qobject_cast<QQuickAbstractAnimation *>(item);

    setLoopCount(job->loopCount());

    // Instead of setting duration to job->duration() we need to set it to -1 so that
    // it runs as long as the job is running on the render thread. If we gave it
    // an explicit duration, it would be stopped, potentially stopping the RT animation
    // prematurely.
    // This means that the animation driver will tick on the GUI thread as long
    // as the animation is running on the render thread, but this overhead will
    // be negligiblie compared to animating and re-rendering the scene on the render thread.
    m_duration = -1;

    QObject *ctx = findAnimationContext(m_animation);
    if (!ctx) {
        qWarning("QtQuick: unable to find animation context for RT animation...");
        return;
    }

    QQuickWindow *window = qobject_cast<QQuickWindow *>(ctx);
    if (window) {
        setWindow(window);
    } else {
        QQuickItem *item = qobject_cast<QQuickItem *>(ctx);
        if (item->window())
            setWindow(item->window());
        connect(item, SIGNAL(windowChanged(QQuickWindow*)), this, SLOT(windowChanged(QQuickWindow*)));
    }
}
Example #8
0
BasicAnimator::BasicAnimator( QObject *parent )
    : QAbstractAnimation( parent ), current_frame( 0 )
{
    setFps( 15 );
    setLoopCount( -1 );
}
Example #9
0
TileAnimationDriver::TileAnimationDriver(QObject *parent)
    : QAbstractAnimation(parent)
    , mLastTime(0)
{
    setLoopCount(-1); // loop forever
}
Example #10
0
WallClockPrivate::WallClockPrivate(WallClock *wallClock)
    : q(wallClock), m_updateFreq(WallClock::Second), m_enabled(true)
{
    setLoopCount(-1);
    update();
}
Example #11
0
LogicDriver::LogicDriver(QObject *parent) :
    QAbstractAnimation(parent)
{
    setLoopCount(-1); // loop forever
}
Example #12
0
StepDriver::StepDriver(Box2DWorld *world)
    : QAbstractAnimation(world)
    , mWorld(world)
{
    setLoopCount(-1); // loop forever
}