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


C++ QLCInputChannel::type方法代码示例

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


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

示例1: type

void QLCInputChannel_Test::type()
{
	QLCInputChannel ch;
	QVERIFY(ch.type() == QLCInputChannel::Button);

	ch.setType(QLCInputChannel::Slider);
	QVERIFY(ch.type() == QLCInputChannel::Slider);

	ch.setType(QLCInputChannel::Button);
	QVERIFY(ch.type() == QLCInputChannel::Button);

	ch.setType(QLCInputChannel::Knob);
	QVERIFY(ch.type() == QLCInputChannel::Knob);
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例2: slotMovementComboChanged

void InputProfileEditor::slotMovementComboChanged(int index)
{
    QLCInputChannel* channel;
    quint32 chnum;
    QTreeWidgetItem* item;

    if (index == 1)
        m_sensitivitySpin->setEnabled(true);
    else
        m_sensitivitySpin->setEnabled(false);

    QListIterator <QTreeWidgetItem*>
    it(m_tree->selectedItems());
    while (it.hasNext() == true)
    {
        item = it.next();
        Q_ASSERT(item != NULL);

        chnum = item->text(KColumnNumber).toUInt() - 1;
        channel = m_profile->channel(chnum);
        Q_ASSERT(channel != NULL);

        if (channel->type() == QLCInputChannel::Slider)
        {
            if (index == 1)
                channel->setMovementType(QLCInputChannel::Relative);
            else
                channel->setMovementType(QLCInputChannel::Absolute);
        }
    }
}
开发者ID:lelazary,项目名称:qlcplus,代码行数:31,代码来源:inputprofileeditor.cpp

示例3: slotItemClicked

void InputProfileEditor::slotItemClicked(QTreeWidgetItem *item, int col)
{
    Q_UNUSED(col)

    quint32 chNum = item->text(KColumnNumber).toUInt() - 1;
    QLCInputChannel *ich = m_profile->channel(chNum);
    if (ich != NULL)
    {
        if (ich->type() == QLCInputChannel::Slider)
        {
            m_behaviourBox->show();
            if (ich->movementType() == QLCInputChannel::Absolute)
            {
                m_movementCombo->setCurrentIndex(0);
                m_sensitivitySpin->setEnabled(false);
            }
            else
            {
                m_movementCombo->setCurrentIndex(1);
                m_sensitivitySpin->setValue(ich->movementSensitivity());
                m_sensitivitySpin->setEnabled(true);
            }
        }
        else
            m_behaviourBox->hide();
    }
}
开发者ID:lelazary,项目名称:qlcplus,代码行数:27,代码来源:inputprofileeditor.cpp

示例4: set

bool InputPatch::set(QLCIOPlugin* plugin, quint32 input, QLCInputProfile* profile)
{
    bool result = false;

    if (m_plugin != NULL && m_input != QLCIOPlugin::invalidLine())
    {
        disconnect(m_plugin, SIGNAL(valueChanged(quint32,quint32,quint32,uchar,QString)),
                   this, SLOT(slotValueChanged(quint32,quint32,quint32,uchar,QString)));
        m_plugin->closeInput(m_input);
    }

    m_plugin = plugin;
    m_input = input;
    m_profile = profile;

    /* Open the assigned plugin input */
    if (m_plugin != NULL && m_input != QLCIOPlugin::invalidLine())
    {
        connect(m_plugin, SIGNAL(valueChanged(quint32,quint32,quint32,uchar,QString)),
                this, SLOT(slotValueChanged(quint32,quint32,quint32,uchar,QString)));
        result = m_plugin->openInput(m_input);

        if (m_profile != NULL)
        {
            QMapIterator <quint32,QLCInputChannel*> it(m_profile->channels());
            while (it.hasNext() == true)
            {
                it.next();
                QLCInputChannel *ch = it.value();
                if (ch != NULL)
                {
                    if (m_nextPageCh == USHRT_MAX && ch->type() == QLCInputChannel::NextPage)
                        m_nextPageCh = m_profile->channelNumber(ch);
                    else if (m_prevPageCh == USHRT_MAX && ch->type() == QLCInputChannel::PrevPage)
                        m_prevPageCh = m_profile->channelNumber(ch);
                    else if (m_pageSetCh == USHRT_MAX && ch->type() == QLCInputChannel::PageSet)
                        m_pageSetCh = m_profile->channelNumber(ch);
                }
            }
        }
    }
    return result;
}
开发者ID:Babbsdrebbler,项目名称:qlcplus,代码行数:43,代码来源:inputpatch.cpp

示例5: setProfilePageControls

void InputPatch::setProfilePageControls()
{
    if (m_profile != NULL)
    {
        QMapIterator <quint32,QLCInputChannel*> it(m_profile->channels());
        while (it.hasNext() == true)
        {
            it.next();
            QLCInputChannel *ch = it.value();
            if (ch != NULL)
            {
                if (m_nextPageCh == USHRT_MAX && ch->type() == QLCInputChannel::NextPage)
                    m_nextPageCh = m_profile->channelNumber(ch);
                else if (m_prevPageCh == USHRT_MAX && ch->type() == QLCInputChannel::PrevPage)
                    m_prevPageCh = m_profile->channelNumber(ch);
                else if (m_pageSetCh == USHRT_MAX && ch->type() == QLCInputChannel::PageSet)
                    m_pageSetCh = m_profile->channelNumber(ch);
            }
        }
    }
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:21,代码来源:inputpatch.cpp

示例6: copy

void QLCInputChannel_Test::copy()
{
	QLCInputChannel ch;
	ch.setType(QLCInputChannel::Slider);
	ch.setName("Foobar");

	QLCInputChannel copy(ch);
	QVERIFY(copy.type() == QLCInputChannel::Slider);
	QVERIFY(copy.name() == "Foobar");

	QLCInputChannel another = ch;
	QVERIFY(another.type() == QLCInputChannel::Slider);
	QVERIFY(another.name() == "Foobar");
}
开发者ID:,项目名称:,代码行数:14,代码来源:

示例7: updateInputSource

void InputSelectionWidget::updateInputSource()
{
    QString uniName;
    QString chName;

    if (!m_inputSource || m_doc->inputOutputMap()->inputSourceNames(m_inputSource, uniName, chName) == false)
    {
        uniName = KInputNone;
        chName = KInputNone;
        m_lowerSpin->setEnabled(false);
        m_upperSpin->setEnabled(false);
    }
    else
    {
        m_lowerSpin->blockSignals(true);
        m_upperSpin->blockSignals(true);

        uchar min = 0, max = UCHAR_MAX;

        InputPatch *ip = m_doc->inputOutputMap()->inputPatch(m_inputSource->universe());
        if (ip != NULL && ip->profile() != NULL)
        {
            QLCInputChannel *ich = ip->profile()->channel(m_inputSource->channel());
            if (ich != NULL && ich->type() == QLCInputChannel::Button)
            {
                min = ich->lowerValue();
                max = ich->upperValue();
            }
        }
        m_lowerSpin->setValue((m_inputSource->lowerValue() != 0) ? m_inputSource->lowerValue() : min);
        m_upperSpin->setValue((m_inputSource->upperValue() != UCHAR_MAX) ? m_inputSource->upperValue() : max);
        if (m_lowerSpin->value() != 0 || m_upperSpin->value() != UCHAR_MAX)
            m_customFbButton->setChecked(true);
        m_lowerSpin->blockSignals(false);
        m_upperSpin->blockSignals(false);
        m_lowerSpin->setEnabled(true);
        m_upperSpin->setEnabled(true);
    }

    m_inputUniverseEdit->setText(uniName);
    m_inputChannelEdit->setText(chName);
}
开发者ID:riksolo,项目名称:qlcplus,代码行数:42,代码来源:inputselectionwidget.cpp

示例8: loadWrongType

void QLCInputChannel_Test::loadWrongType()
{
	QDomDocument doc;

	QDomElement root = doc.createElement("Channel");
	doc.appendChild(root);

	QDomElement name = doc.createElement("Name");
	QDomText nameText = doc.createTextNode("Foobar");
	name.appendChild(nameText);
	root.appendChild(name);

	QDomElement type = doc.createElement("Type");
	QDomText typeText = doc.createTextNode("Xyzzy");
	type.appendChild(typeText);
	root.appendChild(type);

	QLCInputChannel ch;
	ch.loadXML(&root);
	QVERIFY(ch.name() == "Foobar");
	QVERIFY(ch.type() == QLCInputChannel::NoType);
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例9: slotSensitivitySpinChanged

void InputProfileEditor::slotSensitivitySpinChanged(int value)
{
    QLCInputChannel* channel;
    quint32 chnum;
    QTreeWidgetItem* item;

    QListIterator <QTreeWidgetItem*>
    it(m_tree->selectedItems());
    while (it.hasNext() == true)
    {
        item = it.next();
        Q_ASSERT(item != NULL);

        chnum = item->text(KColumnNumber).toUInt() - 1;
        channel = m_profile->channel(chnum);
        Q_ASSERT(channel != NULL);

        if (channel->type() == QLCInputChannel::Slider &&
            channel->movementType() == QLCInputChannel::Relative)
                channel->setMovementSensitivity(value);
    }
}
开发者ID:lelazary,项目名称:qlcplus,代码行数:22,代码来源:inputprofileeditor.cpp

示例10: isButton

bool VCSlider::isButton(quint32 universe, quint32 channel)
{
    InputPatch* patch = NULL;
    QLCInputProfile* profile = NULL;
    QLCInputChannel* ch = NULL;

    patch = m_doc->inputMap()->patch(universe);
    if (patch != NULL)
    {
        profile = patch->profile();
        if (profile != NULL)
        {
            ch = profile->channels()[channel];
            if (ch != NULL)
            {
                return (ch->type() == QLCInputChannel::Button);
            }
        }
    }

    return false;
}
开发者ID:roberts-sandbox,项目名称:qlcplus,代码行数:22,代码来源:vcslider.cpp

示例11: slotInputValueChanged

void InputProfileEditor::slotInputValueChanged(quint32 universe,
                                               quint32 channel,
                                               uchar value,
                                               const QString& key)
{
    QTreeWidgetItem* latestItem = NULL;

    Q_UNUSED(universe);

    /* Get a list of items that represent the given channel. Basically
       the list should always contain just one item. */
    QList <QTreeWidgetItem*> list;
    if (channel == UINT_MAX && key.isEmpty() == false)
        list = m_tree->findItems(key, Qt::MatchExactly, KColumnName);
    else
        list = m_tree->findItems(QString("%1").arg(channel + 1), Qt::MatchExactly,
                             KColumnNumber);
    if (list.size() != 0)
        latestItem = list.first();

    if (list.size() == 0 && m_wizardActive == true)
    {
        /* No channel items found. Create a new channel to the
           profile and display it also in the tree widget */
        QLCInputChannel* ch = new QLCInputChannel();
        if(key.isEmpty())
            ch->setName(tr("Button %1").arg(channel + 1));
        else
            ch->setName(key);
        ch->setType(QLCInputChannel::Button);
        m_profile->insertChannel(channel, ch);

        latestItem = new QTreeWidgetItem(m_tree);
        updateChannelItem(latestItem, ch);
    }
    else if (m_wizardActive == true)
    {
        /* Existing channel & item found. Modify their contents. */
        latestItem = list.first();
        QVariant var = latestItem->data(KColumnValues, Qt::UserRole);
        QStringList values(var.toStringList());

        if (values.size() > 3)
        {
            /* No need to collect any more values, since this channel has
               been judged to be a slider when count == 3 (see below). */
        }
        else if (values.contains(QString("%1").arg(value)) == false)
        {
            values << QString("%1").arg(value);
            values.sort();
            latestItem->setData(KColumnValues, Qt::UserRole, values);
        }

        /* Change the channel type only the one time when its value
           count goes over 2. I.e. when a channel can have more than
           two distinct values, it can no longer be a button. */
        if (values.size() == 3)
        {
            QLCInputChannel* ch = m_profile->channel(channel);
            Q_ASSERT(ch != NULL);

            if (ch->type() == QLCInputChannel::Button)
            {
                ch->setType(QLCInputChannel::Slider);
                if(key.isEmpty())
                    ch->setName(tr("Slider %1").arg(channel + 1));
                else
                    ch->setName(key);
                updateChannelItem(latestItem, ch);
            }
        }
    }

    if (latestItem != NULL)
    {
        if (m_latestItem != NULL)
            m_latestItem->setIcon(KColumnNumber, QIcon());
        m_latestItem = latestItem;
        m_latestItem->setIcon(KColumnNumber, QIcon(":/input.png"));
        m_tree->scrollToItem(m_latestItem);
        m_timer->start(250);
    }
}
开发者ID:lelazary,项目名称:qlcplus,代码行数:84,代码来源:inputprofileeditor.cpp


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