本文整理汇总了C++中QLCInputProfile类的典型用法代码示例。如果您正苦于以下问题:C++ QLCInputProfile类的具体用法?C++ QLCInputProfile怎么用?C++ QLCInputProfile使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了QLCInputProfile类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: it
void InputMap::loadProfiles(const QDir& dir)
{
if (dir.exists() == false || dir.isReadable() == false)
return;
/* Go thru all found file entries and attempt to load an input
profile from each of them. */
QStringListIterator it(dir.entryList());
while (it.hasNext() == true)
{
QLCInputProfile* prof;
QString path;
path = dir.absoluteFilePath(it.next());
prof = QLCInputProfile::loader(path);
if (prof != NULL)
{
/* Check for duplicates */
if (profile(prof->name()) == NULL)
addProfile(prof);
else
delete prof;
}
else
{
qWarning() << Q_FUNC_INFO << "Unable to find an input profile from" << path;
}
}
}
示例2: model
void QLCInputProfile_Test::model()
{
QLCInputProfile ip;
QVERIFY(ip.model().isEmpty());
ip.setModel("BCF2000");
QVERIFY(ip.model() == "BCF2000");
}
示例3: manufacturer
void QLCInputProfile_Test::manufacturer()
{
QLCInputProfile ip;
QVERIFY(ip.manufacturer() == QString::null);
ip.setManufacturer("Behringer");
QVERIFY(ip.manufacturer() == "Behringer");
}
示例4: model
void QLCInputProfile_Test::model()
{
QLCInputProfile ip;
QVERIFY(ip.model() == QString::null);
ip.setModel("BCF2000");
QVERIFY(ip.model() == "BCF2000");
}
示例5: manufacturer
void QLCInputProfile_Test::manufacturer()
{
QLCInputProfile ip;
QVERIFY(ip.manufacturer().isEmpty());
ip.setManufacturer("Behringer");
QVERIFY(ip.manufacturer() == "Behringer");
}
示例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: fillTree
void SelectInputChannel::fillTree()
{
QLCInputChannel* channel;
QTreeWidgetItem* uniItem;
QTreeWidgetItem* chItem;
QLCInputProfile* profile;
quint32 uni;
InputPatch* patch;
/* Add an option to select no input at all */
chItem = new QTreeWidgetItem(m_tree);
chItem->setText(KColumnName, KInputNone);
chItem->setText(KColumnUniverse, QString("%1")
.arg(InputMap::invalidUniverse()));
chItem->setText(KColumnChannel, QString("%1")
.arg(KInputChannelInvalid));
for (uni = 0; uni < _app->inputMap()->universes(); uni++)
{
/* Get the patch associated to the current universe */
patch = _app->inputMap()->patch(uni);
Q_ASSERT(patch != NULL);
/* Make an item for each universe */
uniItem = new QTreeWidgetItem(m_tree);
updateUniverseItem(uniItem, uni, patch);
if (patch->plugin() != NULL && patch->input() != KInputInvalid)
{
/* Add a manual option to each patched universe */
chItem = new QTreeWidgetItem(uniItem);
updateChannelItem(chItem, uni, NULL, NULL);
}
/* Add known channels from profile (if any) */
profile = patch->profile();
if (profile != NULL)
{
QMapIterator <quint32, QLCInputChannel*>
it(profile->channels());
while (it.hasNext() == true)
{
channel = it.next().value();
Q_ASSERT(channel != NULL);
chItem = new QTreeWidgetItem(uniItem);
updateChannelItem(chItem, uni, channel,
profile);
}
}
}
/* Listen to item changed signals so that we can catch user's
manual input for <...> nodes. Connect AFTER filling the tree
so all the initial item->setText()'s won't get caught here. */
connect(m_tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)),
this, SLOT(slotItemChanged(QTreeWidgetItem*,int)));
}
示例8: loadNoProfile
void QLCInputProfile_Test::loadNoProfile()
{
QDomDocument doc;
QLCInputProfile ip;
QVERIFY(ip.loadXML(doc) == false);
QDomElement root = doc.createElement("Whatever");
doc.appendChild(root);
QVERIFY(ip.loadXML(doc) == false);
}
示例9: it
QLCInputProfile* InputMap::profile(const QString& name)
{
QListIterator <QLCInputProfile*> it(m_profiles);
while (it.hasNext() == true)
{
QLCInputProfile* profile = it.next();
if (profile->name() == name)
return profile;
}
return NULL;
}
示例10: loadNoProfile
void QLCInputProfile_Test::loadNoProfile()
{
QXmlStreamReader doc;
QLCInputProfile ip;
QVERIFY(ip.loadXML(doc) == false);
QBuffer buffer;
buffer.open(QIODevice::ReadWrite);
QXmlStreamWriter xmlWriter(&buffer);
xmlWriter.writeStartElement("Whatever");
doc.setDevice(&buffer);
QVERIFY(ip.loadXML(doc) == false);
}
示例11: it
void InputMap::removeProfile(const QString& name)
{
QLCInputProfile* profile;
QMutableListIterator <QLCInputProfile*> it(m_profiles);
while (it.hasNext() == true)
{
profile = it.next();
if (profile->name() == name)
{
it.remove();
delete profile;
break;
}
}
}
示例12: QVERIFY
void QLCInputProfile_Test::loader()
{
QLCInputProfile* prof = QLCInputProfile::loader("foobar");
QVERIFY(prof == NULL);
prof = QLCInputProfile::loader("broken.xml");
QVERIFY(prof == NULL);
QString path(PROFILEDIR "Generic-MIDI.qxi");
prof = QLCInputProfile::loader(path);
QVERIFY(prof != NULL);
QCOMPARE(prof->path(), path);
QCOMPARE(prof->name(), QString("Generic MIDI"));
QCOMPARE(prof->channels().size(), 256);
}
示例13: inputSourceNames
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;
}
示例14: xmlWriter
void QLCInputProfile_Test::load()
{
QBuffer buffer;
buffer.open(QIODevice::WriteOnly | QIODevice::Text);
QXmlStreamWriter xmlWriter(&buffer);
xmlWriter.writeStartDocument();
xmlWriter.writeDTD("<!DOCTYPE InputProfile>");
xmlWriter.writeStartElement("InputProfile");
xmlWriter.writeTextElement("Manufacturer", "Behringer");
xmlWriter.writeTextElement("Model", "BCF2000");
xmlWriter.writeStartElement("Channel");
xmlWriter.writeAttribute("Number", "492");
xmlWriter.writeTextElement("Name", "Foobar");
xmlWriter.writeTextElement("Type", "Slider");
xmlWriter.writeEndDocument();
xmlWriter.setDevice(NULL);
buffer.close();
buffer.open(QIODevice::ReadOnly | QIODevice::Text);
QXmlStreamReader xmlReader(&buffer);
QLCInputProfile ip;
QVERIFY(ip.loadXML(xmlReader) == true);
QVERIFY(ip.manufacturer() == "Behringer");
QVERIFY(ip.model() == "BCF2000");
QVERIFY(ip.channels().size() == 1);
QVERIFY(ip.channel(492) != NULL);
QVERIFY(ip.channel(492)->name() == "Foobar");
QVERIFY(ip.channel(492)->type() == QLCInputChannel::Slider);
}
示例15: inputSourceNames
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;
}