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


C++ Fixture::channel方法代码示例

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


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

示例1: slotAddClicked

void VCXYPadProperties::slotAddClicked()
{
    /* Put all fixtures already present into a list of fixtures that
       will be disabled in the fixture selection dialog */
    QList <t_fixture_id> disabled;
    QTreeWidgetItemIterator twit(m_tree);
    while (*twit != NULL)
    {
        QVariant var((*twit)->data(KColumnFixture, Qt::UserRole));
        VCXYPadFixture fxi(var);
        disabled << fxi.fixture();
        ++twit;
    }

    /* Disable all fixtures that don't have pan OR tilt channels */
    for (t_fixture_id fxi_id = 0; fxi_id < KFixtureArraySize; fxi_id++)
    {
        Fixture* fixture = _app->doc()->fixture(fxi_id);
        if (fixture == NULL)
            continue;

        // If a channel with pan group exists, don't disable this fixture
        if (fixture->channel("", Qt::CaseSensitive, QLCChannel::Pan)
                != QLCChannel::invalid())
        {
            continue;
        }

        // If a channel with tilt group exists, don't disable this fixture
        if (fixture->channel("", Qt::CaseSensitive, QLCChannel::Tilt)
                != QLCChannel::invalid())
        {
            continue;
        }

        // Disable all fixtures without pan or tilt channels
        disabled << fxi_id;

    }

    /* Get a list of new fixtures to add to the pad */
    QTreeWidgetItem* item = NULL;
    FixtureSelection fs(this, _app->doc(), true, disabled);
    if (fs.exec() == QDialog::Accepted)
    {
        QListIterator <t_fixture_id> it(fs.selection);
        while (it.hasNext() == true)
        {
            VCXYPadFixture fxi;
            fxi.setFixture(it.next());
            item = new QTreeWidgetItem(m_tree);
            updateFixtureItem(item, fxi);
        }
    }

    if (item != NULL)
        m_tree->setCurrentItem(item);
}
开发者ID:alexpaulzor,项目名称:ChaosDMX,代码行数:58,代码来源:vcxypadproperties.cpp

示例2: writeDMXLevel

void VCSlider::writeDMXLevel(MasterTimer* timer, UniverseArray* universes)
{
    Q_UNUSED(timer);

    m_levelValueMutex.lock();

    QListIterator <LevelChannel> it(m_levelChannels);
    while (it.hasNext() == true)
    {
        LevelChannel lch(it.next());
        Fixture* fxi = m_doc->fixture(lch.fixture);
        if (fxi != NULL)
        {
            const QLCChannel* qlcch = fxi->channel(lch.channel);
            if (qlcch == NULL)
                continue;

            if (qlcch->group() != QLCChannel::Intensity &&
                m_levelValueChanged == false)
            {
                /* Value has not changed and this is not an intensity channel.
                   LTP in effect. */
                continue;
            }

            quint32 dmx_ch = fxi->channelAddress(lch.channel);
            universes->write(dmx_ch, m_levelValue, qlcch->group());
        }
    }
    m_levelValueChanged = false;
    m_levelValueMutex.unlock();
}
开发者ID:roberts-sandbox,项目名称:qlcplus,代码行数:32,代码来源:vcslider.cpp

示例3: getChannelTypeMask

quint32 FunctionManager::getChannelTypeMask(quint32 fxID, quint32 channel)
{
    Fixture *fixture = m_doc->fixture(fxID);
    if (fixture == NULL)
        return 0;

    const QLCChannel *ch = fixture->channel(channel);
    if (ch == NULL)
        return 0;

    quint32 chTypeBit = 0;

    if (ch->group() == QLCChannel::Intensity)
    {
        if (ch->colour() == QLCChannel::NoColour)
            chTypeBit |= ContextManager::DimmerType;
        else
            chTypeBit |= ContextManager::ColorType;
    }
    else
    {
        chTypeBit |= (1 << ch->group());
    }

    return chTypeBit;
}
开发者ID:ming-hai,项目名称:qlcplus,代码行数:26,代码来源:functionmanager.cpp

示例4: setFixture

void FixtureConsole::setFixture(t_fixture_id id)
{
    ConsoleChannel* cc = NULL;
    Fixture* fxi = NULL;

    /* Get rid of any previous channels */
    while (m_channels.isEmpty() == false)
        delete m_channels.takeFirst();

    m_fixture = id;

    fxi = _app->doc()->fixture(m_fixture);
    Q_ASSERT(fxi != NULL);

    /* Create channel units */
    for (unsigned int i = 0; i < fxi->channels(); i++)
    {
        const QLCChannel* ch = fxi->channel(i);
        Q_ASSERT(ch != NULL);
        if (ch->group() == QLCChannel::NoGroup)
            continue;

        cc = new ConsoleChannel(this, m_fixture, i);
        cc->setCheckable(m_channelsCheckable);
        layout()->addWidget(cc);

        connect(cc, SIGNAL(valueChanged(quint32,uchar,bool)),
                this, SLOT(slotValueChanged(quint32,uchar,bool)));

        m_channels.append(cc);
    }

    /* Make a spacer item eat excess space to justify channels left */
    layout()->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding));
}
开发者ID:alexpaulzor,项目名称:ChaosDMX,代码行数:35,代码来源:fixtureconsole.cpp

示例5: channelIcon

QString FixtureManager::channelIcon(quint32 fxID, quint32 chIdx)
{
    Fixture *fixture = m_doc->fixture(fxID);
    if (fixture == NULL)
        return QString();

    const QLCChannel *channel = fixture->channel(chIdx);
    if (channel == NULL)
        return QString();

    QString chIcon = channel->getIconNameFromGroup(channel->group());
    if (chIcon.startsWith("#"))
    {
        if (chIcon == "#FF0000") return "qrc:/red.svg";
        else if (chIcon == "#00FF00") return "qrc:/green.svg";
        else if (chIcon == "#0000FF") return "qrc:/blue.svg";
        else if (chIcon == "#00FFFF") return "qrc:/cyan.svg";
        else if (chIcon == "#FF00FF") return "qrc:/magenta.svg";
        else if (chIcon == "#FFFF00") return "qrc:/yellow.svg";
        else if (chIcon == "#FF7E00") return "qrc:/amber.svg";
        else if (chIcon == "#FFFFFF") return "qrc:/white.svg";
        else if (chIcon == "#9400D3") return "qrc:/uv.svg";
    }
    else
        chIcon.replace(".png", ".svg");

    return "qrc" + chIcon;
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:28,代码来源:fixturemanager.cpp

示例6: init

void FixtureList::init()
{
    QTreeWidgetItem* item;
    
    m_listView->clear();

    connect(m_listView, SIGNAL(itemSelectionChanged()),
        this, SLOT(slotSelectionChanged()));
    connect(m_listView, SIGNAL(itemDoubleClicked(QTreeWidgetItem*)),
        this, SLOT(slotItemDoubleClicked()));
    
    for (t_fixture_id fxi_id = 0; fxi_id < KFixtureArraySize; fxi_id++)
    {
        Fixture* fxi = _app->doc()->fixture(fxi_id);
        if (fxi == NULL)
            continue;

        for (unsigned int n = 0; n < fxi->channels(); n++)
        {
            QLCChannel* channel;
            QString s;

            // Create a new item for a channel
            item = new QTreeWidgetItem(m_listView);

            // Fixture name
            item->setText(KColumnFixtureName, fxi->name());
            
            // Channel name
            channel = fxi->channel(n);
            if (channel != NULL)
            {
                s.sprintf("%.3d: ", n + 1);
                s += channel->name();
                item->setText(KColumnChannelName, s);
            }
            else
            {
                delete item;
                break;
            }
            
            // Relative channel number (not shown)
            s.sprintf("%.3d", n);
            item->setText(KColumnChannelNum, s);
            
            // Fixture ID (not shown)
            item->setText(KColumnFixtureID,
                      QString("%1").arg(fxi_id));
        }   
    }
    
    /* Select the first item */
    item = m_listView->topLevelItem(0);
    if (item != NULL)
        item->setSelected(true);
}
开发者ID:speakman,项目名称:qlc,代码行数:57,代码来源:fixturelist.cpp

示例7: init

void FixtureList::init()
{
    QListViewItem* item = NULL;
    QLCChannel* channel = NULL;
    Fixture* fxi = NULL;
    unsigned int n = 0;
    QString fxi_id;
    QString s;
    
    m_listView->clear();
    
    for (t_fixture_id i = 0; i < KFixtureArraySize; i++)
    {
        fxi = _app->doc()->fixture(i);
        if (fxi == NULL)
            continue;

        fxi_id.setNum(fxi->id());
        
        for (n = 0; n < fxi->channels(); n++)
        {
            // Create a new item for a channel
            item = new QListViewItem(m_listView);

            // Fixture name
            item->setText(KColumnFixtureName, fxi->name());
            
            // Channel name
            channel = fxi->channel(n);
            if (channel != NULL)
            {
                s.sprintf("%.3d: ", n + 1);
                s += channel->name();
                item->setText(KColumnChannelName, s);
            }
            else
            {
                delete item;
                break;
            }
            
            // Relative channel number (not shown)
            s.sprintf("%.3d", n);
            item->setText(KColumnChannelNum, s);
            
            // Fixture ID (not shown)
            item->setText(KColumnFixtureID, fxi_id);
        }   
    }
    
    m_listView->setSelected(m_listView->firstChild(), true);
}
开发者ID:speakman,项目名称:qlc,代码行数:52,代码来源:fixturelist.cpp

示例8: slotAutoFunction

void FixtureManager::slotAutoFunction()
{
#if 0
    QTreeWidgetItem* item;
    t_fixture_id fxi_id;
    Fixture* fxi;

    item = m_tree->currentItem();
    if (item == NULL)
        return;

    fxi_id = item->text(KColumnID).toInt();
    fxi = _app->doc()->fixture(fxi_id);
    Q_ASSERT(fxi != NULL);

    // Loop over all channels
    for (int i = 0; i < fxi->channels(); i++)
    {
        QLCChannel* channel = fxi->channel(i);
        Q_ASSERT(channel != NULL);

        QListIterator <QLCCapability*> 
            cap_it(*channel->capabilities());

        // Loop over all capabilities
        while (cap_it.hasNext() == true)
        {
            QLCCapability* cap = cap_it.next();
            Q_ASSERT(cap != NULL);

            Scene* sc = static_cast<Scene*> 
                (_app->doc()->newFunction(Function::Scene,
                              fxi_id));
            sc->setName(channel->name() + " - " + cap->name());

            // Set the unused channels to NoSet and zero.
            for (int j = 0; j < fxi->channels(); j++)
                sc->set(j, 0, Scene::NoSet);

            // Set only the capability
            sc->set(i, (t_value) ((cap->min() + cap->max()) / 2),
                Scene::Set);
        }
    }
#endif
}
开发者ID:speakman,项目名称:qlc,代码行数:46,代码来源:fixturemanager.cpp

示例9: setupClickAndGoWidget

void VCSlider::setupClickAndGoWidget()
{
    if (m_cngWidget != NULL)
    {
        qDebug() << Q_FUNC_INFO << "Level channel: " << m_levelChannels.size() << "type: " << m_cngType;
        if (m_cngType == ClickAndGoWidget::Preset && m_levelChannels.size() > 0)
        {
            LevelChannel lChan = m_levelChannels.first();
            Fixture *fxi = m_doc->fixture(lChan.fixture);
            if (fxi != NULL)
            {
                const QLCChannel *chan = fxi->channel(lChan.channel);
                m_cngWidget->setType(m_cngType, chan);
            }
        }
        else
            m_cngWidget->setType(m_cngType, NULL);
    }
}
开发者ID:dadoonet,项目名称:qlcplus,代码行数:19,代码来源:vcslider.cpp

示例10: group

QLCChannel::Group FadeChannel::group(const Doc* doc) const
{
    uint chnum = QLCChannel::invalid();
    Fixture* fxi = NULL;

    if (fixture() == Fixture::invalidId())
    {
        // Do a reverse lookup; which fixture occupies channel()
        // which is now treated as an absolute DMX address.
        quint32 id = doc->fixtureForAddress(channel());
        if (id == Fixture::invalidId())
            return QLCChannel::Intensity;

        fxi = doc->fixture(id);
        if (fxi == NULL)
            return QLCChannel::Intensity;

        // Convert channel() to a relative channel number
        chnum = channel() - fxi->universeAddress();
    }
    else
    {
        // This FadeChannel contains a valid fixture ID
        fxi = doc->fixture(fixture());
        if (fxi == NULL)
            return QLCChannel::Intensity;

        // channel() is already a relative channel number
        chnum = channel();
    }

    const QLCChannel* ch = fxi->channel(chnum);
    if (ch == NULL)
        return QLCChannel::Intensity;
    else
        return ch->group();
}
开发者ID:CCLinck21,项目名称:qlcplus,代码行数:37,代码来源:fadechannel.cpp

示例11: init

void ConsoleChannel::init()
{
    Fixture* fxi = m_doc->fixture(m_fixture);
    //Q_ASSERT(fxi != NULL);

    new QVBoxLayout(this);
    layout()->setSpacing(0);
    layout()->setContentsMargins(0, 2, 0, 2);

    if (fxi != NULL)
    {
        m_presetButton = new QToolButton(this);
        m_presetButton->setStyle(AppUtil::saneStyle());
        layout()->addWidget(m_presetButton);
        layout()->setAlignment(m_presetButton, Qt::AlignHCenter);
        m_presetButton->setIconSize(QSize(32, 32));
        m_presetButton->setMinimumSize(QSize(32, 32));
        m_presetButton->setMaximumSize(QSize(32, 32));
        m_presetButton->setFocusPolicy(Qt::NoFocus);

        /* Create a menu only if channel has sophisticated contents */
        if (fxi->fixtureDef() != NULL && fxi->fixtureMode() != NULL)
            initMenu();
        else
            m_presetButton->setStyleSheet("QToolButton { border-image: url(:/intensity.png) 0 0 0 0 stretch stretch; }");
    }

    /* Value edit */
    m_spin = new QSpinBox(this);
    m_spin->setRange(0, UCHAR_MAX);
    m_spin->setValue(0);
    m_spin->setMinimumWidth(25);
    m_spin->setButtonSymbols(QAbstractSpinBox::NoButtons);
    m_spin->setStyle(AppUtil::saneStyle());
    layout()->addWidget(m_spin);
    m_spin->setAlignment(Qt::AlignCenter);
    m_spin->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred);
    layout()->setAlignment(m_spin, Qt::AlignHCenter);

    /* Value slider */
    m_slider = new ClickAndGoSlider(this);
    m_slider->setInvertedAppearance(false);
    m_slider->setRange(0, UCHAR_MAX);
    m_slider->setPageStep(1);
    m_slider->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
    m_slider->setFocusPolicy(Qt::NoFocus);
    connect(m_slider, SIGNAL(controlClicked()),
            this, SLOT(slotControlClicked()));

    m_slider->setMinimumWidth(25);
    m_slider->setMaximumWidth(40);
    m_slider->setStyleSheet(
        "QSlider::groove:vertical { background: transparent; width: 32px; } "

        "QSlider::handle:vertical { "
        "background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #ddd, stop:0.45 #888, stop:0.50 #000, stop:0.55 #888, stop:1 #999);"
        "border: 1px solid #5c5c5c;"
        "border-radius: 4px; margin: 0 -1px; height: 20px; }"

        "QSlider::handle:vertical:hover {"
        "background: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 #eee, stop:0.45 #999, stop:0.50 #ff0000, stop:0.55 #999, stop:1 #ccc);"
        "border: 1px solid #000; }"

        "QSlider::add-page:vertical { background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #78d, stop: 1 #97CDEC );"
        "border: 1px solid #5288A7; margin: 0 13px; }"

        "QSlider::sub-page:vertical { background: QLinearGradient( x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #888, stop: 1 #ddd );"
        "border: 1px solid #8E8A86; margin: 0 13px; }"

        "QSlider::handle:vertical:disabled { background: QLinearGradient(x1:0, y1:0, x2:0, y2:1, stop:0 #ddd, stop:0.45 #888, stop:0.50 #444, stop:0.55 #888, stop:1 #999);"
        "border: 1px solid #666; }"
        );
    layout()->addWidget(m_slider);
    //layout()->setAlignment(m_slider, Qt::AlignHCenter);

    /* Channel number label */
    m_label = new QLabel(this);
    m_label->setMinimumWidth(25);
    m_label->setMaximumWidth(80);
    layout()->addWidget(m_label);
    m_label->setAlignment(Qt::AlignCenter);
    m_label->setText(QString::number(m_channel + 1));
    m_label->setFocusPolicy(Qt::NoFocus);
    m_label->setWordWrap(true);

    /* Set tooltip */
    if (fxi == NULL || fxi->isDimmer() == true)
    {
        setToolTip(tr("Intensity"));
    }
    else
    {
        const QLCChannel* ch = fxi->channel(m_channel);
        Q_ASSERT(ch != NULL);
        setToolTip(QString("%1").arg(ch->name()));
    }

    connect(m_spin, SIGNAL(valueChanged(int)), this, SLOT(slotSpinChanged(int)));
    connect(m_slider, SIGNAL(valueChanged(int)), this, SLOT(slotSliderChanged(int)));
    connect(this, SIGNAL(toggled(bool)), this, SLOT(slotChecked(bool)));
//.........这里部分代码省略.........
开发者ID:Boudewijn26,项目名称:qlcplus,代码行数:101,代码来源:consolechannel.cpp

示例12: createScenes

void IntensityGenerator::createScenes()
{
    m_odd = new Scene(m_doc);
    m_odd->setName("Intensity - Odd");

    m_even = new Scene(m_doc);
    m_even->setName("Intensity - Even");

    m_full = new Scene(m_doc);
    m_full->setName("Intensity - Full");

    m_zero = new Scene(m_doc);
    m_zero->setName("Intensity - Zero");

    // Create sequence & random scene lists
    int i = 0;
    QListIterator <Fixture*> it(m_fixtures);
    while (it.hasNext() == true)
    {
        Fixture* fxi(it.next());
        Q_ASSERT(fxi != NULL);

        Scene* sq = new Scene(m_doc);
        sq->setName(QString("Intensity - ") + fxi->name());
        m_sequence << sq;

        sq = new Scene(m_doc);
        sq->setName(QString("Intensity - Random - %1").arg(++i));
        m_random << sq;
    }

    // Go thru all fixtures
    for (int i = 0; i < m_fixtures.size(); i++)
    {
        Fixture* fxi = m_fixtures[i];
        Q_ASSERT(fxi != NULL);

        // Find such channels from the fixture that belong to the
        // given channel group.
        QList <quint32> channels = findChannels(fxi, QLCChannel::Intensity);

        // Insert values to member scenes for each found channel
        for (int j = 0; j < channels.size(); j++)
        {
            quint32 ch = channels.at(j);
            const QLCChannel* channel = fxi->channel(ch);
            Q_ASSERT(channel != NULL);

            uchar min = 0;
            uchar max = UCHAR_MAX;
            int modulo = i;

            // Find the minimum and maximum intensity values for
            // the current channel
            findMinMax(channel, &min, &max);

            // Set all intensity channels to max in the $full scene
            m_full->setValue(fxi->id(), ch, max);

            // Set all intensity channels to min in the $zero scene
            m_zero->setValue(fxi->id(), ch, min);

            // Create even & odd values
            if (fxi->isDimmer() == false)
                modulo = i; // For each intelligent fixture
            else
                modulo = j; // For each dimmer channel

            if ((modulo % 2) == 0)
            {
                m_even->setValue(fxi->id(), ch, max);
                m_odd->setValue(fxi->id(), ch, min);
            }
            else
            {
                m_even->setValue(fxi->id(), ch, min);
                m_odd->setValue(fxi->id(), ch, max);
            }

            // Create sequence and random values
            for (int s = 0; s < m_sequence.size(); s++)
            {
                if (s == i)
                    m_sequence[s]->setValue(fxi->id(), ch, max);
                else
                    m_sequence[s]->setValue(fxi->id(), ch, min);

                if ((rand() % 2) == 0)
                    m_random[s]->setValue(fxi->id(), ch, max);
                else
                    m_random[s]->setValue(fxi->id(), ch, min);
            }
        }
    }
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:95,代码来源:intensitygenerator.cpp

示例13: channel

QMultiHash<int, SceneValue> FixtureManager::setFixtureCapabilities(quint32 fxID, bool enable)
{
    int capDelta = 1;
    bool hasDimmer = false, hasColor = false, hasPosition = false;

    QMultiHash<int, SceneValue> channelsMap;

    Fixture *fixture = m_doc->fixture(fxID);
    if (fixture == NULL)
        return channelsMap;

    if (enable == false)
        capDelta = -1;

    for (quint32 ch = 0; ch < fixture->channels(); ch++)
    {
        const QLCChannel* channel(fixture->channel(ch));
        if(channel == NULL)
            continue;

        int chType = channel->group();

        switch (channel->group())
        {
            case QLCChannel::Intensity:
            {
                QLCChannel::PrimaryColour col = channel->colour();
                switch (col)
                {
                    case QLCChannel::NoColour:
                        hasDimmer = true;
                    break;
                    case QLCChannel::Red:
                    case QLCChannel::Green:
                    case QLCChannel::Blue:
                    case QLCChannel::Cyan:
                    case QLCChannel::Magenta:
                    case QLCChannel::Yellow:
                    case QLCChannel::White:
                        hasColor = true;
                    break;
                    default: break;
                }
                chType = col;
            }
            break;
            case QLCChannel::Pan:
            case QLCChannel::Tilt:
                hasPosition = true;
            break;
            default:
            break;
        }
        if (hasDimmer)
        {
            QQuickItem *dimmerCapItem = qobject_cast<QQuickItem*>(m_view->rootObject()->findChild<QObject *>("capIntensity"));
            dimmerCapItem->setProperty("counter", dimmerCapItem->property("counter").toInt() + capDelta);
        }
        if (hasColor)
        {
            QQuickItem *colorCapItem = qobject_cast<QQuickItem*>(m_view->rootObject()->findChild<QObject *>("capColor"));
            colorCapItem->setProperty("counter", colorCapItem->property("counter").toInt() + capDelta);
        }
        if (hasPosition)
        {
            QQuickItem *positionCapItem = qobject_cast<QQuickItem*>(m_view->rootObject()->findChild<QObject *>("capPosition"));
            positionCapItem->setProperty("counter", positionCapItem->property("counter").toInt() + capDelta);
        }

        channelsMap.insert(chType, SceneValue(fxID, ch));
    }
    return channelsMap;
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:73,代码来源:fixturemanager.cpp

示例14: initMenu

void ConsoleChannel::initMenu()
{
    Fixture* fxi = m_doc->fixture(fixture());
    Q_ASSERT(fxi != NULL);

    const QLCChannel* ch = fxi->channel(m_channel);
    Q_ASSERT(ch != NULL);

    // Get rid of a possible previous menu
    if (m_menu != NULL)
    {
        delete m_menu;
        m_menu = NULL;
    }

    // Create a popup menu and set the channel name as its title
    m_menu = new QMenu(this);
    m_presetButton->setMenu(m_menu);
    m_presetButton->setPopupMode(QToolButton::InstantPopup);

    QString btnIconStr = ch->getIconNameFromGroup(ch->group());
    if (btnIconStr.startsWith(":"))
        m_presetButton->setStyleSheet("QToolButton { border-image: url(" + btnIconStr + ") 0 0 0 0 stretch stretch; }");
    else
    {
        m_presetButton->setStyleSheet("QToolButton { background: " + btnIconStr + "; }");
        setIntensityButton(ch);
    }

    switch(ch->group())
    {
    case QLCChannel::Colour:
        m_cngWidget = new ClickAndGoWidget();
        m_cngWidget->setType(ClickAndGoWidget::Preset, ch);
        break;
    case QLCChannel::Effect:
        m_cngWidget = new ClickAndGoWidget();
        m_cngWidget->setType(ClickAndGoWidget::Preset, ch);
        break;
    case QLCChannel::Gobo:
        m_cngWidget = new ClickAndGoWidget();
        m_cngWidget->setType(ClickAndGoWidget::Preset, ch);
        break;
    default:
        break;
    }

    if (m_cngWidget != NULL)
    {
        QWidgetAction* action = new QWidgetAction(this);
        action->setDefaultWidget(m_cngWidget);
        m_menu->addAction(action);
        connect(m_cngWidget, SIGNAL(levelChanged(uchar)),
                this, SLOT(slotClickAndGoLevelChanged(uchar)));
        connect(m_cngWidget, SIGNAL(levelAndPresetChanged(uchar,QImage)),
                this, SLOT(slotClickAndGoLevelAndPresetChanged(uchar, QImage)));
    }
    else
    {
        QAction* action = m_menu->addAction(m_presetButton->icon(), ch->name());
        m_menu->setTitle(ch->name());
        action->setEnabled(false);
        m_menu->addSeparator();

        // Initialize the preset menu only for intelligent fixtures
        if (fxi->isDimmer() == false)
            initCapabilityMenu(ch);
    }
}
开发者ID:Boudewijn26,项目名称:qlcplus,代码行数:69,代码来源:consolechannel.cpp

示例15: writeDMXLevel

void VCSlider::writeDMXLevel(MasterTimer* timer, UniverseArray* universes)
{
    Q_UNUSED(timer);

    m_levelValueMutex.lock();

    uchar modLevel = m_levelValue;

    int r = 0, g = 0, b = 0, c = 0, m = 0, y = 0;
    if (m_cngType == ClickAndGoWidget::RGB)
    {
        float f = 0;
        if (m_slider)
            f = SCALE(float(m_levelValue), float(m_slider->minimum()),
                      float(m_slider->maximum()), float(0), float(200));
        if ((uchar)f != 0)
        {
            QColor modColor = m_cngRGBvalue.lighter((uchar)f);
            r = modColor.red();
            g = modColor.green();
            b = modColor.blue();
        }
    }
    else if (m_cngType == ClickAndGoWidget::CMY)
    {
        float f = 0;
        if (m_slider)
            f = SCALE(float(m_levelValue), float(m_slider->minimum()),
                      float(m_slider->maximum()), float(0), float(200));
        if ((uchar)f != 0)
        {
            QColor modColor = m_cngRGBvalue.lighter((uchar)f);
            c = modColor.cyan();
            m = modColor.magenta();
            y = modColor.yellow();
        }
    }

    QListIterator <LevelChannel> it(m_levelChannels);
    while (it.hasNext() == true)
    {
        LevelChannel lch(it.next());
        Fixture* fxi = m_doc->fixture(lch.fixture);
        if (fxi != NULL)
        {
            const QLCChannel* qlcch = fxi->channel(lch.channel);
            if (qlcch == NULL)
                continue;

            if (qlcch->group() != QLCChannel::Intensity &&
                m_levelValueChanged == false)
            {
                /* Value has not changed and this is not an intensity channel.
                   LTP in effect. */
                continue;
            }
            if (qlcch->group() == QLCChannel::Intensity)
            {
                if (m_cngType == ClickAndGoWidget::RGB)
                {
                    if (qlcch->colour() == QLCChannel::Red)
                        modLevel = (uchar)r;
                    else if (qlcch->colour() == QLCChannel::Green)
                        modLevel = (uchar)g;
                    else if (qlcch->colour() == QLCChannel::Blue)
                        modLevel = (uchar)b;
                }
                else if (m_cngType == ClickAndGoWidget::CMY)
                {
                    if (qlcch->colour() == QLCChannel::Cyan)
                        modLevel = (uchar)c;
                    else if (qlcch->colour() == QLCChannel::Magenta)
                        modLevel = (uchar)m;
                    else if (qlcch->colour() == QLCChannel::Yellow)
                        modLevel = (uchar)y;
                }
            }

            quint32 dmx_ch = fxi->channelAddress(lch.channel);
            universes->write(dmx_ch, modLevel, qlcch->group());
        }
    }
    m_levelValueChanged = false;
    m_levelValueMutex.unlock();
}
开发者ID:hokowa3,项目名称:qlcplus,代码行数:85,代码来源:vcslider.cpp


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