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


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

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


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

示例1: preRun

void EFX::preRun(MasterTimer* timer)
{
    int serialNumber = 0;

    QListIterator <EFXFixture*> it(m_fixtures);
    while (it.hasNext() == true)
    {
        EFXFixture* ef = it.next();
        Q_ASSERT(ef != NULL);
        ef->setSerialNumber(serialNumber++);
    }

    Q_ASSERT(m_fader == NULL);
    m_fader = new GenericFader(doc());

    Function::preRun(timer);
}
开发者ID:Unknownly,项目名称:qlcplus,代码行数:17,代码来源:efx.cpp

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

示例3: 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
    }
}
开发者ID:speakman,项目名称:qlc,代码行数:40,代码来源:efxfixture_test.cpp

示例4: 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

示例5: 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

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

示例7: arm

void EFX::arm()
{
    class Scene* startScene = NULL;
    class Scene* stopScene = NULL;
    QLCFixtureMode* mode = NULL;
    QLCChannel* ch = NULL;
    int serialNumber = 0;
    Fixture* fxi = NULL;

    /* Initialization scene */
    if (m_startSceneID != KNoID && m_startSceneEnabled == true)
        startScene = static_cast <class Scene*>
            (_app->doc()->function(m_startSceneID));

    /* De-initialization scene */
    if (m_stopSceneID != KNoID && m_stopSceneEnabled == true)
        stopScene = static_cast <class Scene*>
            (_app->doc()->function(m_stopSceneID));

    QListIterator <EFXFixture*> it(m_fixtures);
    while (it.hasNext() == true)
    {
        EFXFixture* ef = it.next();
        Q_ASSERT(ef != NULL);

        ef->setSerialNumber(serialNumber++);
        ef->setStartScene(startScene);
        ef->setStopScene(stopScene);

        /* If fxi == NULL, the fixture has been destroyed */
        fxi = _app->doc()->fixture(ef->fixture());
        if (fxi == NULL)
            continue;

        /* If this fixture has no mode, it's a generic dimmer that
           can't do pan&tilt anyway. */
        mode = fxi->fixtureMode();
        if (mode == NULL)
            continue;

        /* Find exact channel numbers for MSB/LSB pan and tilt */
        for (t_channel i = 0; i < mode->channels(); i++)
        {
            ch = mode->channel(i);
            Q_ASSERT(ch != NULL);

            if (ch->group() == KQLCChannelGroupPan)
            {
                if (ch->controlByte() == 0)
                {
                    ef->setMsbPanChannel(
                        fxi->universeAddress() + i);
                }
                else if (ch->controlByte() == 1)
                {
                    ef->setLsbPanChannel(
                        fxi->universeAddress() + i);
                }
            }
            else if (ch->group() == KQLCChannelGroupTilt)
            {
                if (ch->controlByte() == 0)
                {
                    ef->setMsbTiltChannel(
                        fxi->universeAddress() + i);
                }
                else if (ch->controlByte() == 1)
                {
                    ef->setLsbTiltChannel(
                        fxi->universeAddress() + i);
                }
            }
        }
    }

    /* Choose a point calculation function depending on the algorithm */
    if (m_algorithm == KCircleAlgorithmName)
        pointFunc = circlePoint;
    else if (m_algorithm == KEightAlgorithmName)
        pointFunc = eightPoint;
    else if (m_algorithm == KLineAlgorithmName)
        pointFunc = linePoint;
    else if (m_algorithm == KTriangleAlgorithmName)
        pointFunc = trianglePoint;
    else if (m_algorithm == KDiamondAlgorithmName)
        pointFunc = diamondPoint;
    else if (m_algorithm == KLissajousAlgorithmName)
        pointFunc = lissajousPoint;
    else
        pointFunc = NULL;
}
开发者ID:,项目名称:,代码行数:91,代码来源:


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