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


C++ Doc::inputOutputMap方法代码示例

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


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

示例1: timerTick

void MasterTimer::timerTick()
{
    Doc* doc = qobject_cast<Doc*> (parent());
    Q_ASSERT(doc != NULL);

#ifdef DEBUG_MASTERTIMER
    qDebug() << "[MasterTimer] *********** tick:" << ticksCount++ << "**********";
#endif

    doc->inputOutputMap()->flushInputs();

    QList<Universe *> universes = doc->inputOutputMap()->claimUniverses();
    for (int i = 0 ; i < universes.count(); i++)
    {
        universes[i]->zeroIntensityChannels();
        universes[i]->zeroRelativeValues();
    }

    timerTickFunctions(universes);
    timerTickDMXSources(universes);
    timerTickFader(universes);

    doc->inputOutputMap()->releaseUniverses();
    doc->inputOutputMap()->dumpUniverses();
}
开发者ID:PML369,项目名称:qlcplus,代码行数:25,代码来源:mastertimer.cpp

示例2: timerTick

void MasterTimer::timerTick()
{
    Doc* doc = qobject_cast<Doc*> (parent());
    Q_ASSERT(doc != NULL);

#ifdef DEBUG_MASTERTIMER
    qDebug() << "[MasterTimer] *********** tick:" << ticksCount++ << "**********";
#endif

    switch (m_beatSourceType)
    {
        case Internal:
        {
            int elapsedTime = qRound((double)m_beatTimer->nsecsElapsed() / 1000000) + m_lastBeatOffset;
            //qDebug() << "Elapsed beat:" << elapsedTime;
            if (elapsedTime >= m_beatTimeDuration)
            {
                // it's time to fire a beat
                m_beatRequested = true;

                // restart the time for the next beat, starting at a delta
                // milliseconds, otherwise it will generate an unpleasant drift
                //qDebug() << "Elapsed:" << elapsedTime << ", delta:" << elapsedTime - m_beatTimeDuration;
                m_lastBeatOffset = elapsedTime - m_beatTimeDuration;
                m_beatTimer->restart();

                // inform the listening classes that a beat is happening
                emit beat();
            }
        }
        break;
        case External:
        break;

        case None:
        default:
            m_beatRequested = false;
        break;
    }

    QList<Universe *> universes = doc->inputOutputMap()->claimUniverses();
    for (int i = 0 ; i < universes.count(); i++)
    {
        universes[i]->flushInput();
        universes[i]->zeroIntensityChannels();
        universes[i]->zeroRelativeValues();
    }

    timerTickFunctions(universes);
    timerTickDMXSources(universes);
    timerTickFader(universes);

    doc->inputOutputMap()->releaseUniverses();
    doc->inputOutputMap()->dumpUniverses();

    m_beatRequested = false;
}
开发者ID:boxy321,项目名称:qlcplus,代码行数:57,代码来源:mastertimer.cpp

示例3: fadeAndStopAll

void MasterTimer::fadeAndStopAll(int timeout)
{
    if (timeout == 0)
        return;

    Doc* doc = qobject_cast<Doc*> (parent());
    Q_ASSERT(doc != NULL);

    QList<FadeChannel> fcList;

    QList<Universe *> universes = doc->inputOutputMap()->claimUniverses();
    for (int i = 0; i < universes.count(); i++)
    {
        QHashIterator <int,uchar> it(universes[i]->intensityChannels());
        while (it.hasNext() == true)
        {
            it.next();

            Fixture* fxi = doc->fixture(doc->fixtureForAddress(it.key()));
            if (fxi != NULL)
            {
                uint ch = it.key() - fxi->universeAddress();
                if (fxi->channelCanFade(ch))
                {
                    FadeChannel fc(doc, fxi->id(), ch);
                    fc.setStart(it.value());
                    fc.setTarget(0);
                    fc.setFadeTime(timeout);
                    fcList.append(fc);
                }
            }
        }
    }
    doc->inputOutputMap()->releaseUniverses();

    // Stop all functions first
    stopAllFunctions();

    // Instruct mastertimer to do a fade out of all
    // the intensity channels that can fade
    QMutexLocker faderLocker(&m_faderMutex);
    foreach(FadeChannel fade, fcList)
        fader()->add(fade);
}
开发者ID:PML369,项目名称:qlcplus,代码行数:44,代码来源:mastertimer.cpp


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