Ejemplo n.º 1
0
void InputOutputMap::setBlackout(bool blackout)
{
    /* Don't do blackout twice */
    if (m_blackout == blackout)
        return;
    m_blackout = blackout;

    if (blackout == true)
    {
        QByteArray zeros(512, 0);
        for (quint32 i = 0; i < universesCount(); i++)
        {
            Universe *universe = m_universeArray.at(i);
            if (universe->outputPatch() != NULL)
                universe->outputPatch()->dump(universe->id(), zeros);
        }
    }
    else
    {
        /* Force writing of values back to the plugins */
        m_universeChanged = true;
    }

    emit blackoutChanged(m_blackout);
}
Ejemplo n.º 2
0
void InputOutputMap::setBlackout(bool blackout)
{
    /* Don't do blackout twice */
    if (m_blackout == blackout)
        return;

    QMutexLocker locker(&m_universeMutex);
    m_blackout = blackout;

    QByteArray zeros(512, 0);
    for (quint32 i = 0; i < universesCount(); i++)
    {
        Universe *universe = m_universeArray.at(i);
        if (universe->outputPatch() != NULL)
        {
            if (blackout == true)
                universe->outputPatch()->dump(universe->id(), zeros);
            // notify the universe listeners that some channels have changed
        }
        locker.unlock();
        if (blackout == true)
            emit universesWritten(i, zeros);
        else
        {
            const QByteArray postGM = universe->postGMValues()->mid(0, universe->usedChannels());
            emit universesWritten(i, postGM);
        }
        locker.relock();
    }

    emit blackoutChanged(m_blackout);
}
Ejemplo n.º 3
0
bool InputOutputMap::removeAllUniverses()
{
    quint32 uniCount = universesCount();
    for (quint32 i = 0; i < uniCount; i++)
    {
        Universe *uni = m_universeArray.takeLast();
        delete uni;
    }
    m_latestUniverseId = invalidUniverse();
    return true;
}
Ejemplo n.º 4
0
bool InputOutputMap::setInputPatch(quint32 universe, const QString &pluginName,
                                   quint32 input, const QString &profileName)
{
    /* Check that the universe that we're doing mapping for is valid */
    if (universe >= universesCount())
    {
        qWarning() << Q_FUNC_INFO << "Universe" << universe << "out of bounds.";
        return false;
    }

    QMutexLocker locker(&m_universeMutex);
    InputPatch *currInPatch = m_universeArray.at(universe)->inputPatch();
    QLCInputProfile *currProfile = NULL;
    if (currInPatch != NULL)
    {
        currProfile = currInPatch->profile();
        disconnect(currInPatch, SIGNAL(inputValueChanged(quint32,quint32,uchar,const QString&)),
                this, SIGNAL(inputValueChanged(quint32,quint32,uchar,const QString&)));
    }