本文整理汇总了C++中QLCInputChannel类的典型用法代码示例。如果您正苦于以下问题:C++ QLCInputChannel类的具体用法?C++ QLCInputChannel怎么用?C++ QLCInputChannel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QLCInputChannel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Q_UNUSED
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();
}
}
示例2: it
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);
}
}
}
示例3: QLCInputChannel
void InputProfileEditor::slotAddClicked()
{
QLCInputChannel* channel = new QLCInputChannel();
InputChannelEditor ice(this, m_profile, channel);
add:
if (ice.exec() == QDialog::Accepted)
{
channel->setType(ice.type());
channel->setName(ice.name());
if (m_profile->channel(ice.channel()) == NULL)
{
m_profile->insertChannel(ice.channel(), channel);
updateChannelItem(new QTreeWidgetItem(m_tree), channel);
}
else
{
QMessageBox::warning(this,
tr("Channel already exists"),
tr("Channel %1 already exists")
.arg(ice.channel() + 1));
goto add;
}
}
else
{
delete channel;
}
}
示例4: tr
bool VCPropertiesEditor::inputSourceNames(quint32 universe, quint32 channel,
QString& uniName, QString& chName) const
{
if (universe == InputMap::invalidUniverse() || channel == InputMap::invalidChannel())
{
/* Nothing selected for input universe and/or channel */
return false;
}
InputPatch* patch = m_inputMap->patch(universe);
if (patch == NULL || patch->plugin() == NULL)
{
/* There is no patch for the given universe */
return false;
}
QLCInputProfile* profile = patch->profile();
if (profile == NULL)
{
/* There is no profile. Display plugin name and channel number.
Boring. */
uniName = patch->plugin()->name();
chName = tr("%1: Unknown").arg(channel + 1);
}
else
{
QLCInputChannel* ich;
QString name;
/* Display profile name for universe */
uniName = QString("%1: %2").arg(universe + 1).arg(profile->name());
/* User can input the channel number by hand, so put something
rational to the channel name in those cases as well. */
ich = profile->channel(channel);
if (ich != NULL)
name = ich->name();
else
name = tr("Unknown");
/* Display channel name */
chName = QString("%1: %2").arg(channel + 1).arg(name);
}
return true;
}
示例5: name
void QLCInputChannel_Test::name()
{
QLCInputChannel ch;
QVERIFY(ch.name() == QString::null);
ch.setName("Foobar");
QVERIFY(ch.name() == "Foobar");
}
示例6: sendFeedback
void GrandMasterSlider::sendFeedback()
{
quint32 universe = VirtualConsole::instance()->properties().grandMasterInputUniverse();
quint32 channel = VirtualConsole::instance()->properties().grandMasterInputChannel();
QString chName;
if (universe == InputOutputMap::invalidUniverse() || channel == QLCChannel::invalid())
return;
InputPatch* pat = m_ioMap->inputPatch(universe);
if (pat != NULL)
{
QLCInputProfile* profile = pat->profile();
if (profile != NULL)
{
QLCInputChannel* ich = profile->channel(channel);
if (ich != NULL)
chName = ich->name();
}
}
if (m_slider->invertedAppearance())
m_ioMap->sendFeedBack(universe, channel, UCHAR_MAX - m_slider->value(), chName);
else
m_ioMap->sendFeedBack(universe, channel, m_slider->value(), chName);
}
示例7: QString
bool InputMap::inputSourceNames(const QLCInputSource& src,
QString& uniName, QString& chName) const
{
if (src.isValid() == false)
return false;
InputPatch* pat = this->patch(src.universe());
if (pat == NULL)
{
/* There is no patch for the given universe */
return false;
}
QLCInputProfile* profile = pat->profile();
if (profile == NULL)
{
/* There is no profile. Display plugin name and channel number. */
if (pat->plugin() != NULL)
uniName = QString("%1: %2").arg(src.universe() + 1).arg(pat->plugin()->name());
else
uniName = QString("%1: ??").arg(src.universe() + 1);
chName = QString("%1: ?").arg(src.channel() + 1);
}
else
{
QLCInputChannel* ich;
QString name;
/* Display profile name for universe */
uniName = QString("%1: %2").arg(src.universe() + 1).arg(profile->name());
/* User can input the channel number by hand, so put something
rational to the channel name in those cases as well. */
ich = profile->channel(src.channel());
if (ich != NULL)
name = ich->name();
else
name = QString("?");
/* Display channel name */
chName = QString("%1: %2").arg(src.channel() + 1).arg(name);
}
return true;
}
示例8: disconnect
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;
}
示例9: 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);
}
示例10: it
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);
}
}
}
}
示例11: QVERIFY
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);
}
示例12: return
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;
}
示例13: 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");
}
示例14: tr
void VCSliderProperties::updateInputSource()
{
QLCInputProfile* profile;
InputPatch* patch;
QString uniName;
QString chName;
if (m_inputUniverse == InputMap::invalidUniverse() ||
m_inputChannel == InputMap::invalidChannel())
{
/* Nothing selected for input universe and/or channel */
uniName = KInputNone;
chName = KInputNone;
}
else
{
patch = m_inputMap->patch(m_inputUniverse);
if (patch == NULL || patch->plugin() == NULL)
{
/* There is no patch for the given universe */
uniName = KInputNone;
chName = KInputNone;
}
else
{
profile = patch->profile();
if (profile == NULL)
{
/* There is no profile. Display plugin
name and channel number. Boring. */
uniName = patch->plugin()->name();
chName = tr("%1: Unknown")
.arg(m_inputChannel + 1);
}
else
{
QLCInputChannel* ich;
QString name;
/* Display profile name for universe */
uniName = QString("%1: %2")
.arg(m_inputUniverse + 1)
.arg(profile->name());
/* User can input the channel number by hand,
so put something rational to the channel
name in those cases as well. */
ich = profile->channel(m_inputChannel);
if (ich != NULL)
name = ich->name();
else
name = tr("Unknown");
/* Display channel name */
chName = QString("%1: %2")
.arg(m_inputChannel + 1).arg(name);
}
}
}
/* Display the gathered information */
m_inputUniverseEdit->setText(uniName);
m_inputChannelEdit->setText(chName);
}
示例15: Q_ASSERT
void InputProfileEditor::slotEditClicked()
{
QLCInputChannel* channel;
quint32 chnum;
QTreeWidgetItem* item;
if (m_tree->selectedItems().count() == 1)
{
/* Just one item selected. Edit that. */
item = m_tree->currentItem();
if (item == NULL)
return;
/* Find the channel object associated to the selected item */
chnum = item->text(KColumnNumber).toUInt() - 1;
channel = m_profile->channel(chnum);
Q_ASSERT(channel != NULL);
/* Edit the channel and update its item if necessary */
InputChannelEditor ice(this, m_profile, channel);
edit:
if (ice.exec() == QDialog::Accepted)
{
QLCInputChannel* another;
another = m_profile->channel(ice.channel());
if (another == NULL || another == channel)
{
if (ice.channel() != QLCChannel::invalid())
m_profile->remapChannel(channel, ice.channel());
if (ice.name().isEmpty() == false)
channel->setName(ice.name());
if (ice.type() != QLCInputChannel::NoType)
channel->setType(ice.type());
updateChannelItem(item, channel);
}
else
{
QMessageBox::warning(this,
tr("Channel already exists"),
tr("Channel %1 already exists")
.arg(ice.channel() + 1));
goto edit;
}
}
}
else if (m_tree->selectedItems().count() > 1)
{
/* Multiple channels selected. Apply changes to all of them */
InputChannelEditor ice(this, NULL, NULL);
if (ice.exec() == QDialog::Accepted)
{
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);
/* Set only name and type and only if they
have been modified. */
if (ice.name().isEmpty() == false)
channel->setName(ice.name());
if (ice.type() != QLCInputChannel::NoType)
channel->setType(ice.type());
updateChannelItem(item, channel);
}
}
}
}