本文整理汇总了C++中EFXFixture::nextStep方法的典型用法代码示例。如果您正苦于以下问题:C++ EFXFixture::nextStep方法的具体用法?C++ EFXFixture::nextStep怎么用?C++ EFXFixture::nextStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EFXFixture
的用法示例。
在下文中一共展示了EFXFixture::nextStep方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: write
bool EFX::write(QByteArray* universes)
{
int ready = 0;
Q_ASSERT(universes != NULL);
/* Check that a valid point function is present and there's at least
one fixture to control. */
if (pointFunc == NULL || m_fixtures.isEmpty() == true)
return false;
QListIterator <EFXFixture*> it(m_fixtures);
while (it.hasNext() == true)
{
EFXFixture* ef = it.next();
if (ef->isReady() == false)
ef->nextStep(universes);
else
ready++;
}
/* Check for stop condition */
if (ready == m_fixtures.count())
return false;
else
return true;
}
示例2: write
void EFX::write(MasterTimer* timer, QList<Universe*> universes)
{
Q_UNUSED(timer);
int ready = 0;
if (isPaused())
return;
QListIterator <EFXFixture*> it(m_fixtures);
while (it.hasNext() == true)
{
EFXFixture* ef = it.next();
if (ef->isReady() == false)
ef->nextStep(timer, universes);
else
ready++;
}
incrementElapsed();
/* Check for stop condition */
if (ready == m_fixtures.count())
stop(FunctionParent::master());
m_fader->write(universes);
}
示例3: nextStepSingleShot
void EFXFixture_Test::nextStepSingleShot()
{
QByteArray array;
EFX e(m_doc);
e.slotBusValueChanged(e.busID(), 50); /* 50 steps */
e.pointFunc = e.circlePoint;
e.setRunOrder(EFX::SingleShot);
EFXFixture* ef = new EFXFixture(&e);
ef->setFixture(0);
e.addFixture(ef);
/* Nothing should happen since isValid() == false */
ef->nextStep(&array);
QVERIFY(array.size() == 0);
/* Initialize the EFXFixture so that it can do math */
ef->setSerialNumber(0);
ef->setMsbPanChannel(0);
ef->setMsbTiltChannel(1);
ef->setLsbPanChannel(2);
ef->setLsbTiltChannel(3);
QVERIFY(ef->isValid() == true);
QVERIFY(ef->m_initialized == false);
QVERIFY(ef->m_iterator == 0);
ef->reset();
/* Run one cycle (50 steps) and reset the checking iterator in
the middle to expect correct iterator values. */
qreal checkIter = 0;
for (int i = 0; i < 50; i++)
{
ef->nextStep(&array);
checkIter += e.m_stepSize;
QVERIFY(ef->m_initialized == true);
QVERIFY(ef->m_iterator == checkIter);
QVERIFY(ef->isReady() == false);
}
ef->nextStep(&array);
/* Single-shot EFX should now be ready */
QVERIFY(ef->isReady() == true);
}
示例4: nextStepLoop
void EFXFixture_Test::nextStepLoop()
{
QByteArray array;
EFX e(m_doc);
e.slotBusValueChanged(e.busID(), 50); /* 50 steps */
e.pointFunc = e.circlePoint;
EFXFixture* ef = new EFXFixture(&e);
ef->setFixture(0);
e.addFixture(ef);
/* Nothing should happen since isValid() == false */
ef->nextStep(&array);
QVERIFY(array.size() == 0);
/* Initialize the EFXFixture so that it can do math */
ef->setSerialNumber(0);
ef->setMsbPanChannel(0);
ef->setMsbTiltChannel(1);
ef->setLsbPanChannel(2);
ef->setLsbTiltChannel(3);
QVERIFY(ef->isValid() == true);
QVERIFY(ef->m_initialized == false);
QVERIFY(ef->m_iterator == 0);
/* Run two cycles (2 * 50 = 100) and reset the checking iterator in
the middle to expect correct iterator values. */
qreal checkIter = 0;
for (int i = 0; i < 100; i++)
{
ef->nextStep(&array);
checkIter += e.m_stepSize;
if (i == 50)
checkIter = 0;
QVERIFY(ef->m_iterator == checkIter);
QVERIFY(ef->m_initialized == true);
QVERIFY(ef->isReady() == false); // Loop is never ready
}
}
示例5: nextStepSingleShot
void EFXFixture_Test::nextStepSingleShot()
{
QList<Universe*> ua;
ua.append(new Universe(0, new GrandMaster()));
MasterTimerStub mts(m_doc, ua);
EFX e(m_doc);
e.setDuration(1000); // 1s
e.setRunOrder(EFX::SingleShot);
EFXFixture* ef = new EFXFixture(&e);
ef->setHead(GroupHead(0,0));
e.addFixture(ef);
/* Initialize the EFXFixture so that it can do math */
ef->setSerialNumber(0);
QVERIFY(ef->isValid() == true);
QVERIFY(ef->isReady() == false);
QVERIFY(ef->m_elapsed == 0);
e.preRun(&mts);
ef->reset();
/* Run one cycle (50 steps) */
uint max = MasterTimer::tick() * MasterTimer::frequency();
for (uint i = MasterTimer::tick(); i < max; i += MasterTimer::tick())
{
ef->nextStep(&mts, ua);
QVERIFY(ef->isReady() == false);
QCOMPARE(ef->m_elapsed, i);
}
ef->nextStep(&mts, ua);
/* Single-shot EFX should now be ready */
QVERIFY(ef->isReady() == true);
e.postRun(&mts, ua);
}
示例6: nextStepLoopZeroDuration
void EFXFixture_Test::nextStepLoopZeroDuration()
{
QList<Universe*> ua;
ua.append(new Universe(0, new GrandMaster()));
MasterTimerStub mts(m_doc, ua);
EFX e(m_doc);
e.setDuration(0); // 0s
EFXFixture* ef = new EFXFixture(&e);
ef->setHead(GroupHead(0,0));
e.addFixture(ef);
/* Initialize the EFXFixture so that it can do math */
ef->setSerialNumber(0);
QVERIFY(ef->isValid() == true);
QVERIFY(ef->isReady() == false);
QVERIFY(ef->m_elapsed == 0);
e.preRun(&mts);
/* Run two cycles (2 * tickms * freq) to see that Loop never quits */
uint max = MasterTimer::tick() * MasterTimer::frequency();
uint i = MasterTimer::tick();
for (uint times = 0; times < 2; times++)
{
for (; i < max; i += MasterTimer::tick())
{
ef->nextStep(&mts, ua);
QVERIFY(ef->isReady() == false); // Loop is never ready
QCOMPARE(ef->m_elapsed, i);
}
// m_elapsed is NOT zeroed since there are no "rounds" when duration == 0
}
e.postRun(&mts, ua);
}
示例7: nextStepLoop
void EFXFixture_Test::nextStepLoop()
{
UniverseArray array(512 * 4);
MasterTimerStub mts(m_doc, array);
EFX e(m_doc);
e.setDuration(1000); // 1s
EFXFixture* ef = new EFXFixture(&e);
ef->setFixture(0);
e.addFixture(ef);
/* Initialize the EFXFixture so that it can do math */
ef->setSerialNumber(0);
QVERIFY(ef->isValid() == true);
QVERIFY(ef->isReady() == false);
QVERIFY(ef->m_elapsed == 0);
e.preRun(&mts);
/* Run two cycles (2 * tickms * freq) to see that Loop never quits */
uint max = MasterTimer::tick() * MasterTimer::frequency();
uint i = MasterTimer::tick();
for (uint times = 0; times < 2; times++)
{
for (; i < max; i += MasterTimer::tick())
{
ef->nextStep(&mts, &array);
QVERIFY(ef->isReady() == false); // Loop is never ready
QCOMPARE(ef->m_elapsed, i);
}
i = 0; // m_elapsed is zeroed after a full pass
}
e.postRun(&mts, &array);
}