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


C++ QLCInputProfile类代码示例

本文整理汇总了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;
        }
    }
}
开发者ID:Unknownly,项目名称:qlcplus,代码行数:29,代码来源:inputmap.cpp

示例2: model

void QLCInputProfile_Test::model()
{
    QLCInputProfile ip;
    QVERIFY(ip.model().isEmpty());
    ip.setModel("BCF2000");
    QVERIFY(ip.model() == "BCF2000");
}
开发者ID:CCLinck21,项目名称:qlcplus,代码行数:7,代码来源:qlcinputprofile_test.cpp

示例3: manufacturer

void QLCInputProfile_Test::manufacturer()
{
	QLCInputProfile ip;
	QVERIFY(ip.manufacturer() == QString::null);
	ip.setManufacturer("Behringer");
	QVERIFY(ip.manufacturer() == "Behringer");
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例4: model

void QLCInputProfile_Test::model()
{
	QLCInputProfile ip;
	QVERIFY(ip.model() == QString::null);
	ip.setModel("BCF2000");
	QVERIFY(ip.model() == "BCF2000");
}
开发者ID:,项目名称:,代码行数:7,代码来源:

示例5: manufacturer

void QLCInputProfile_Test::manufacturer()
{
    QLCInputProfile ip;
    QVERIFY(ip.manufacturer().isEmpty());
    ip.setManufacturer("Behringer");
    QVERIFY(ip.manufacturer() == "Behringer");
}
开发者ID:CCLinck21,项目名称:qlcplus,代码行数:7,代码来源:qlcinputprofile_test.cpp

示例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);
}
开发者ID:PML369,项目名称:qlcplus,代码行数:25,代码来源:grandmasterslider.cpp

示例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)));
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:58,代码来源:selectinputchannel.cpp

示例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);
}
开发者ID:CCLinck21,项目名称:qlcplus,代码行数:10,代码来源:qlcinputprofile_test.cpp

示例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;
}
开发者ID:speakman,项目名称:qlc,代码行数:12,代码来源:inputmap.cpp

示例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);
}
开发者ID:PML369,项目名称:qlcplus,代码行数:14,代码来源:qlcinputprofile_test.cpp

示例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;
		}
	}
}
开发者ID:speakman,项目名称:qlc,代码行数:15,代码来源:inputmap.cpp

示例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);
}
开发者ID:CCLinck21,项目名称:qlcplus,代码行数:15,代码来源:qlcinputprofile_test.cpp

示例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;
}
开发者ID:alexpaulzor,项目名称:qlc,代码行数:46,代码来源:vcpropertieseditor.cpp

示例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);
}
开发者ID:PML369,项目名称:qlcplus,代码行数:31,代码来源:qlcinputprofile_test.cpp

示例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;
}
开发者ID:Unknownly,项目名称:qlcplus,代码行数:45,代码来源:inputmap.cpp


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