本文整理汇总了C++中IOPluginStub::name方法的典型用法代码示例。如果您正苦于以下问题:C++ IOPluginStub::name方法的具体用法?C++ IOPluginStub::name怎么用?C++ IOPluginStub::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IOPluginStub
的用法示例。
在下文中一共展示了IOPluginStub::name方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: universeNames
void InputOutputMap_Test::universeNames()
{
InputOutputMap iom(m_doc, 4);
QCOMPARE(quint32(iom.universeNames().size()), iom.universes());
QVERIFY(iom.universeNames().at(0).contains("Universe"));
QVERIFY(iom.universeNames().at(1).contains("Universe"));
QVERIFY(iom.universeNames().at(2).contains("Universe"));
QVERIFY(iom.universeNames().at(3).contains("Universe"));
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
iom.setOutputPatch(0, stub->name(), 3);
QCOMPARE(quint32(iom.universeNames().size()), iom.universes());
QCOMPARE(iom.universeNames().at(0), QString("Universe 1"));
QCOMPARE(iom.universeNames().at(1), QString("Universe 2"));
QCOMPARE(iom.universeNames().at(2), QString("Universe 3"));
QCOMPARE(iom.universeNames().at(3), QString("Universe 4"));
iom.setOutputPatch(3, stub->name(), 2);
QCOMPARE(quint32(iom.universeNames().size()), iom.universes());
QCOMPARE(iom.universeNames().at(0), QString("Universe 1"));
QCOMPARE(iom.universeNames().at(1), QString("Universe 2"));
QCOMPARE(iom.universeNames().at(2), QString("Universe 3"));
QCOMPARE(iom.universeNames().at(3), QString("Universe 4"));
}
示例2: patch
void InputPatch_Test::patch()
{
InputOutputMap im(m_doc, 4);
QCOMPARE(m_doc->ioPluginCache()->plugins().size(), 1);
IOPluginStub* stub = static_cast<IOPluginStub*> (m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QLCInputProfile prof1;
prof1.setManufacturer("Foo");
prof1.setManufacturer("Bar");
InputPatch* ip = new InputPatch(0, this);
ip->set(stub, 0, &prof1);
QVERIFY(ip->m_plugin == stub);
QVERIFY(ip->m_pluginLine == 0);
QVERIFY(ip->m_profile == &prof1);
QVERIFY(ip->pluginName() == stub->name());
QVERIFY(ip->inputName() == stub->inputs()[0]);
QVERIFY(ip->profileName() == prof1.name());
QVERIFY(stub->m_openInputs.size() == 1);
QVERIFY(stub->m_openInputs.at(0) == 0);
QLCInputProfile prof2;
prof2.setManufacturer("Xyzzy");
prof2.setManufacturer("Foobar");
ip->set(stub, 3, &prof2);
QVERIFY(ip->m_plugin == stub);
QVERIFY(ip->m_pluginLine == 3);
QVERIFY(ip->m_profile == &prof2);
QVERIFY(ip->pluginName() == stub->name());
QVERIFY(ip->inputName() == stub->inputs()[3]);
QVERIFY(ip->profileName() == prof2.name());
QVERIFY(stub->m_openInputs.size() == 1);
QVERIFY(stub->m_openInputs.at(0) == 3);
ip->reconnect();
QVERIFY(ip->m_plugin == stub);
QVERIFY(ip->m_pluginLine == 3);
QVERIFY(ip->m_profile == &prof2);
QVERIFY(ip->pluginName() == stub->name());
QVERIFY(ip->inputName() == stub->inputs()[3]);
QVERIFY(ip->profileName() == prof2.name());
QVERIFY(stub->m_openInputs.size() == 1);
QVERIFY(stub->m_openInputs.at(0) == 3);
delete ip;
QVERIFY(stub->m_openInputs.size() == 0);
}
示例3: claimReleaseDumpReset
void InputOutputMap_Test::claimReleaseDumpReset()
{
InputOutputMap iom(m_doc, 4);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
iom.setOutputPatch(0, stub->name(), 0);
iom.setOutputPatch(1, stub->name(), 1);
iom.setOutputPatch(2, stub->name(), 2);
iom.setOutputPatch(3, stub->name(), 3);
QList<Universe*> unis = iom.claimUniverses();
for (int i = 0; i < 512; i++)
unis[0]->write(i, 'a');
for (int i = 0; i < 512; i++)
unis[1]->write(i, 'b');
for (int i = 0; i < 512; i++)
unis[2]->write(i, 'c');
for (int i = 0; i < 512; i++)
unis[3]->write(i, 'd');
iom.releaseUniverses();
iom.dumpUniverses();
for (int i = 0; i < 512; i++)
QCOMPARE(stub->m_universe.data()[i], 'a');
for (int i = 512; i < 1024; i++)
QCOMPARE(stub->m_universe.data()[i], 'b');
for (int i = 1024; i < 1536; i++)
QCOMPARE(stub->m_universe.data()[i], 'c');
for (int i = 1536; i < 2048; i++)
QCOMPARE(stub->m_universe.data()[i], 'd');
iom.resetUniverses();
for (int u = 0; u < iom.m_universeArray.size(); u++)
{
for (quint32 i = 0; i < 512; i++)
QVERIFY(iom.m_universeArray.at(u)->preGMValues().data()[i] == 0);
}
}
示例4: outputPluginStatus
void InputOutputMap_Test::outputPluginStatus()
{
InputOutputMap om(m_doc, 4);
QVERIFY(om.outputPluginStatus("Foo", QLCIOPlugin::invalidLine()).contains("Nothing selected"));
QVERIFY(om.outputPluginStatus("Bar", 0).contains("Nothing selected"));
QVERIFY(om.outputPluginStatus("Baz", 1).contains("Nothing selected"));
QVERIFY(om.outputPluginStatus("Xyzzy", 2).contains("Nothing selected"));
QVERIFY(om.outputPluginStatus("AYBABTU", 3).contains("Nothing selected"));
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QVERIFY(om.outputPluginStatus(stub->name(), 4) == stub->outputInfo(QLCIOPlugin::invalidLine()));
QVERIFY(om.outputPluginStatus(stub->name(), 0) == stub->outputInfo(0));
QVERIFY(om.outputPluginStatus(stub->name(), 1) == stub->outputInfo(1));
QVERIFY(om.outputPluginStatus(stub->name(), 2) == stub->outputInfo(2));
}
示例5: pluginOutputs
void InputOutputMap_Test::pluginOutputs()
{
InputOutputMap om(m_doc, 4);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QStringList ls(om.pluginOutputs(stub->name()));
QVERIFY(ls == stub->outputs());
QVERIFY(om.pluginOutputs("Foobar").isEmpty() == true);
}
示例6: pluginInputs
void InputOutputMap_Test::pluginInputs()
{
InputOutputMap im(m_doc, 4);
QVERIFY(im.pluginInputs("Foo").size() == 0);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QVERIFY(im.pluginInputs(stub->name()).size() == 4);
QVERIFY(im.pluginInputs(stub->name()) == stub->inputs());
}
示例7: inputSourceNames
void InputOutputMap_Test::inputSourceNames()
{
InputOutputMap im(m_doc, 4);
IOPluginStub* stub = static_cast<IOPluginStub*> (m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QDir dir(PROFILEDIR);
dir.setFilter(QDir::Files);
dir.setNameFilters(QStringList() << QString("*%1").arg(KExtInputProfile));
im.loadProfiles(dir);
QString uni, ch;
QVERIFY(im.inputSourceNames(QLCInputSource(0, 0), uni, ch) == false);
QVERIFY(im.setInputPatch(0, stub->name(), 0, QString("Generic MIDI")) == true);
QVERIFY(im.inputSourceNames(QLCInputSource(0, 0), uni, ch) == true);
QCOMPARE(uni, tr("%1: Generic MIDI").arg(1));
QCOMPARE(ch, tr("%1: Bank select MSB").arg(1));
uni.clear();
ch.clear();
QVERIFY(im.inputSourceNames(QLCInputSource(0, 50000), uni, ch) == true);
QCOMPARE(uni, tr("%1: Generic MIDI").arg(1));
QCOMPARE(ch, tr("%1: ?").arg(50001));
QVERIFY(im.setInputPatch(0, stub->name(), 0, QString()) == true);
uni.clear();
ch.clear();
QVERIFY(im.inputSourceNames(QLCInputSource(0, 0), uni, ch) == true);
QCOMPARE(uni, tr("%1: %2").arg(1).arg(stub->name()));
QCOMPARE(ch, tr("%1: ?").arg(1));
QVERIFY(im.inputSourceNames(QLCInputSource(0, QLCInputSource::invalidChannel), uni, ch) == false);
QVERIFY(im.inputSourceNames(QLCInputSource(InputOutputMap::invalidUniverse(), 0), uni, ch) == false);
QVERIFY(im.inputSourceNames(QLCInputSource(), uni, ch) == false);
}
示例8: slotConfigurationChanged
void InputOutputMap_Test::slotConfigurationChanged()
{
InputOutputMap im(m_doc, 4);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QSignalSpy spy(&im, SIGNAL(pluginConfigurationChanged(QString)));
stub->configure();
QCOMPARE(spy.size(), 1);
QCOMPARE(spy.at(0).size(), 1);
QCOMPARE(spy.at(0).at(0).toString(), QString(stub->name()));
}
示例9: configurePlugin
void InputOutputMap_Test::configurePlugin()
{
InputOutputMap im(m_doc, 4);
QCOMPARE(im.canConfigurePlugin("Foo"), false);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QCOMPARE(im.canConfigurePlugin("Foo"), false);
QCOMPARE(im.canConfigurePlugin(stub->name()), false);
stub->m_canConfigure = true;
QCOMPARE(im.canConfigurePlugin(stub->name()), true);
/* Must be able to call multiple times */
im.configurePlugin(stub->name());
QVERIFY(stub->m_configureCalled == 1);
im.configurePlugin(stub->name());
QVERIFY(stub->m_configureCalled == 2);
im.configurePlugin(stub->name());
QVERIFY(stub->m_configureCalled == 3);
}
示例10: slotValueChanged
void InputOutputMap_Test::slotValueChanged()
{
InputOutputMap im(m_doc, 4);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QVERIFY(im.setInputPatch(0, stub->name(), 0) == true);
QVERIFY(im.inputPatch(0)->plugin() == stub);
QVERIFY(im.inputPatch(0)->input() == 0);
QSignalSpy spy(&im, SIGNAL(inputValueChanged(quint32, quint32, uchar, const QString&)));
stub->emitValueChanged(UINT_MAX, 0, 15, UCHAR_MAX);
QVERIFY(spy.size() == 1);
QVERIFY(spy.at(0).at(0) == 0);
QVERIFY(spy.at(0).at(1) == 15);
QVERIFY(spy.at(0).at(2) == UCHAR_MAX);
/* Invalid mapping for this plugin -> no signal */
stub->emitValueChanged(UINT_MAX, 3, 15, UCHAR_MAX);
QVERIFY(spy.size() == 1);
QVERIFY(spy.at(0).at(0) == 0);
QVERIFY(spy.at(0).at(1) == 15);
QVERIFY(spy.at(0).at(2) == UCHAR_MAX);
/* Invalid mapping for this plugin -> no signal */
stub->emitValueChanged(UINT_MAX, 1, 15, UCHAR_MAX);
QVERIFY(spy.size() == 1);
QVERIFY(spy.at(0).at(0) == 0);
QVERIFY(spy.at(0).at(1) == 15);
QVERIFY(spy.at(0).at(2) == UCHAR_MAX);
stub->emitValueChanged(UINT_MAX, 0, 5, 127);
QVERIFY(spy.size() == 2);
QVERIFY(spy.at(0).at(0) == 0);
QVERIFY(spy.at(0).at(1) == 15);
QVERIFY(spy.at(0).at(2) == UCHAR_MAX);
QVERIFY(spy.at(1).at(0) == 0);
QVERIFY(spy.at(1).at(1) == 5);
QVERIFY(spy.at(1).at(2) == 127);
}
示例11: setOutputPatch
void InputOutputMap_Test::setOutputPatch()
{
InputOutputMap iom(m_doc, 4);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QVERIFY(iom.setOutputPatch(0, "Foobar", 0) == true);
QVERIFY(iom.outputPatch(0)->plugin() == NULL);
QVERIFY(iom.outputPatch(0)->output() == QLCIOPlugin::invalidLine());
QVERIFY(iom.outputPatch(1) == NULL);
QVERIFY(iom.outputPatch(2) == NULL);
QVERIFY(iom.outputPatch(3) == NULL);
QVERIFY(iom.setOutputPatch(4, stub->name(), 0) == false);
QVERIFY(iom.outputPatch(0)->plugin() == NULL);
QVERIFY(iom.outputPatch(0)->output() == QLCIOPlugin::invalidLine());
QVERIFY(iom.outputPatch(1) == NULL);
QVERIFY(iom.outputPatch(2) == NULL);
QVERIFY(iom.outputPatch(3) == NULL);
QVERIFY(iom.setOutputPatch(4, stub->name(), 4) == false);
QVERIFY(iom.outputPatch(0)->plugin() == NULL);
QVERIFY(iom.outputPatch(0)->output() == QLCIOPlugin::invalidLine());
QVERIFY(iom.outputPatch(1) == NULL);
QVERIFY(iom.outputPatch(2) == NULL);
QVERIFY(iom.outputPatch(3) == NULL);
QVERIFY(iom.setOutputPatch(3, stub->name(), 0) == true);
QVERIFY(iom.outputPatch(3)->plugin() == stub);
QVERIFY(iom.outputPatch(3)->output() == 0);
QVERIFY(iom.setOutputPatch(2, stub->name(), 1) == true);
QVERIFY(iom.outputPatch(2)->plugin() == stub);
QVERIFY(iom.outputPatch(2)->output() == 1);
QVERIFY(iom.setOutputPatch(1, stub->name(), 2) == true);
QVERIFY(iom.outputPatch(1)->plugin() == stub);
QVERIFY(iom.outputPatch(1)->output() == 2);
QVERIFY(iom.setOutputPatch(0, stub->name(), 3) == true);
QVERIFY(iom.outputPatch(0)->plugin() == stub);
QVERIFY(iom.outputPatch(0)->output() == 3);
}
示例12: blackout
void InputOutputMap_Test::blackout()
{
InputOutputMap iom(m_doc, 4);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
iom.setOutputPatch(0, stub->name(), 0);
iom.setOutputPatch(1, stub->name(), 1);
iom.setOutputPatch(2, stub->name(), 2);
iom.setOutputPatch(3, stub->name(), 3);
QList<Universe*> unis = iom.claimUniverses();
for (int i = 0; i < 512; i++)
unis[0]->write(i, 'a');
for (int i = 0; i < 512; i++)
unis[1]->write(i, 'b');
for (int i = 0; i < 512; i++)
unis[2]->write(i, 'c');
for (int i = 0; i < 512; i++)
unis[3]->write(i, 'd');
iom.releaseUniverses();
iom.dumpUniverses();
iom.setBlackout(true);
QVERIFY(iom.blackout() == true);
iom.dumpUniverses();
for (int i = 0; i < 2048; i++)
QVERIFY(stub->m_universe[i] == (char) 0);
iom.setBlackout(true);
QVERIFY(iom.blackout() == true);
iom.dumpUniverses();
for (int i = 0; i < 2048; i++)
QVERIFY(stub->m_universe[i] == (char) 0);
iom.toggleBlackout();
QVERIFY(iom.blackout() == false);
iom.dumpUniverses();
for (int i = 0; i < 512; i++)
QVERIFY(stub->m_universe[i] == 'a');
for (int i = 512; i < 1024; i++)
QVERIFY(stub->m_universe[i] == 'b');
for (int i = 1024; i < 1536; i++)
QVERIFY(stub->m_universe[i] == 'c');
for (int i = 1536; i < 2048; i++)
QVERIFY(stub->m_universe[i] == 'd');
iom.setBlackout(false);
QVERIFY(iom.blackout() == false);
iom.dumpUniverses();
for (int i = 0; i < 512; i++)
QVERIFY(stub->m_universe[i] == 'a');
for (int i = 512; i < 1024; i++)
QVERIFY(stub->m_universe[i] == 'b');
for (int i = 1024; i < 1536; i++)
QVERIFY(stub->m_universe[i] == 'c');
for (int i = 1536; i < 2048; i++)
QVERIFY(stub->m_universe[i] == 'd');
iom.toggleBlackout();
QVERIFY(iom.blackout() == true);
iom.dumpUniverses();
for (int i = 0; i < 2048; i++)
QVERIFY(stub->m_universe[i] == (char) 0);
}
示例13: setInputPatch
void InputOutputMap_Test::setInputPatch()
{
InputOutputMap im(m_doc, 4);
IOPluginStub* stub = static_cast<IOPluginStub*>
(m_doc->ioPluginCache()->plugins().at(0));
QVERIFY(stub != NULL);
QLCInputProfile* prof = new QLCInputProfile();
prof->setManufacturer("Foo");
prof->setModel("Bar");
im.addProfile(prof);
QVERIFY(im.inputPatch(0) == NULL);
QVERIFY(im.inputPatch(1) == NULL);
QVERIFY(im.inputPatch(2) == NULL);
QVERIFY(im.inputPatch(3) == NULL);
QVERIFY(im.inputMapping(stub->name(), 0) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputMapping(stub->name(), 1) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputMapping(stub->name(), 2) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputMapping(stub->name(), 3) == InputOutputMap::invalidUniverse());
QVERIFY(im.setInputPatch(0, "Foobar", 0, prof->name()) == true);
QVERIFY(im.inputPatch(0) == NULL);
QVERIFY(im.inputMapping(stub->name(), 0) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputPatch(1) == NULL);
QVERIFY(im.inputMapping(stub->name(), 1) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputPatch(2) == NULL);
QVERIFY(im.inputMapping(stub->name(), 2) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputPatch(3) == NULL);
QVERIFY(im.inputMapping(stub->name(), 3) == InputOutputMap::invalidUniverse());
QVERIFY(im.setInputPatch(0, stub->name(), 0) == true);
QVERIFY(im.inputPatch(0)->plugin() == stub);
QVERIFY(im.inputPatch(0)->input() == 0);
QVERIFY(im.inputPatch(0)->profile() == NULL);
QVERIFY(im.inputMapping(stub->name(), 0) == 0);
QVERIFY(im.inputPatch(1) == NULL);
QVERIFY(im.inputMapping(stub->name(), 1) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputPatch(2) == NULL);
QVERIFY(im.inputMapping(stub->name(), 2) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputPatch(3) == NULL);
QVERIFY(im.inputMapping(stub->name(), 3) == InputOutputMap::invalidUniverse());
QVERIFY(im.setInputPatch(2, stub->name(), 3, prof->name()) == true);
QVERIFY(im.inputPatch(0)->plugin() == stub);
QVERIFY(im.inputPatch(0)->input() == 0);
QVERIFY(im.inputPatch(0)->profile() == NULL);
QVERIFY(im.inputMapping(stub->name(), 0) == 0);
QVERIFY(im.inputPatch(1) == NULL);
QVERIFY(im.inputMapping(stub->name(), 1) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputPatch(2)->plugin() == stub);
QVERIFY(im.inputPatch(2)->input() == 3);
QVERIFY(im.inputPatch(2)->profile() == prof);
QVERIFY(im.inputMapping(stub->name(), 2) == InputOutputMap::invalidUniverse());
QVERIFY(im.inputPatch(3) == NULL);
QVERIFY(im.inputMapping(stub->name(), 3) == 2);
// Universe out of bounds
QVERIFY(im.setInputPatch(im.universes(), stub->name(), 0) == false);
}