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(); }
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; }
void MasterTimer::timerTick() { Doc* doc = qobject_cast<Doc*> (parent()); Q_ASSERT(doc != NULL); UniverseArray* universes = doc->outputMap()->claimUniverses(); universes->zeroIntensityChannels(); timerTickFunctions(universes); timerTickDMXSources(universes); timerTickFader(universes); doc->outputMap()->releaseUniverses(); doc->outputMap()->dumpUniverses(); }