当前位置: 首页>>代码示例>>C++>>正文


C++ EFXFixture::setHead方法代码示例

本文整理汇总了C++中EFXFixture::setHead方法的典型用法代码示例。如果您正苦于以下问题:C++ EFXFixture::setHead方法的具体用法?C++ EFXFixture::setHead怎么用?C++ EFXFixture::setHead使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EFXFixture的用法示例。


在下文中一共展示了EFXFixture::setHead方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: stop

void EFXFixture_Test::stop()
{
    QList<Universe*> ua;
    ua.append(new Universe(0, new GrandMaster()));
    MasterTimerStub mts(m_doc, ua);

    EFX e(m_doc);
    e.setFadeInSpeed(1000);
    e.setFadeOutSpeed(2000);
    EFXFixture* ef = new EFXFixture(&e);
    ef->setHead(GroupHead(0,0));
    e.addFixture(ef);

    Fixture* fxi = m_doc->fixture(0);
    QVERIFY(fxi != NULL);

    e.preRun(&mts);

    // Not started yet
    ef->stop(&mts, ua);
    QCOMPARE(e.m_fader->m_channels.size(), 0);
    QCOMPARE(mts.fader()->m_channels.size(), 0);

    // Start
    ef->start(&mts, ua);
    QCOMPARE(e.m_fader->m_channels.size(), 1);
    FadeChannel fc;
    fc.setFixture(m_doc, fxi->id());
    fc.setChannel(fxi->masterIntensityChannel());
    QVERIFY(e.m_fader->m_channels.contains(fc) == true);

    // Then stop
    ef->stop(&mts, ua);
    QCOMPARE(e.m_fader->m_channels.size(), 0);

    // FadeChannels are handed over to MasterTimer's GenericFader
    QCOMPARE(mts.fader()->m_channels.size(), 1);
    QVERIFY(e.m_fader->m_channels.contains(fc) == false);
    QVERIFY(mts.m_fader->m_channels.contains(fc) == true);
    QCOMPARE(mts.m_fader->m_channels[fc].fadeTime(), uint(2000));

    e.postRun(&mts, ua);
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:43,代码来源:efxfixture_test.cpp

示例2: 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);
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:40,代码来源:efxfixture_test.cpp

示例3: 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);
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:38,代码来源:efxfixture_test.cpp

示例4: start

void EFXFixture_Test::start()
{
    QList<Universe*> ua;
    ua.append(new Universe(0, new GrandMaster()));
    MasterTimerStub mts(m_doc, ua);

    EFX e(m_doc);
    e.setFadeInSpeed(1000);
    e.setFadeOutSpeed(2000);
    EFXFixture* ef = new EFXFixture(&e);
    ef->setHead(GroupHead(0,0));
    e.addFixture(ef);

    Fixture* fxi = m_doc->fixture(0);
    QVERIFY(fxi != NULL);

    e.preRun(&mts);

    // Fade intensity == 0, no need to do fade-in
    ef->setFadeIntensity(0);
    ef->start(&mts, ua);
    QCOMPARE(e.m_fader->m_channels.size(), 0);
    ef->m_started = false;

    // Fade intensity > 0, need to do fade-in
    ef->setFadeIntensity(1);
    ef->start(&mts, ua);
    QCOMPARE(e.m_fader->m_channels.size(), 1);

    FadeChannel fc;
    fc.setFixture(m_doc, fxi->id());
    fc.setChannel(fxi->masterIntensityChannel());
    QVERIFY(e.m_fader->m_channels.contains(fc) == true);
    QCOMPARE(e.m_fader->m_channels[fc].fadeTime(), uint(1000));

    e.postRun(&mts, ua);
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:37,代码来源:efxfixture_test.cpp


注:本文中的EFXFixture::setHead方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。