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


C++ QLCFixtureDef::mode方法代码示例

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


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

示例1: addFixture

bool FixtureManager::addFixture(QString manuf, QString model, QString mode, QString name,
                                int uniIdx, int address, int channels, int quantity, quint32 gap,
                                qreal xPos, qreal yPos)
{
    qDebug() << Q_FUNC_INFO << manuf << model << quantity;

    QLCFixtureDef *fxiDef = m_doc->fixtureDefCache()->fixtureDef(manuf, model);
    Q_ASSERT(fxiDef != NULL);

    QLCFixtureMode *fxiMode = fxiDef->mode(mode);
    Q_ASSERT(fxiMode != NULL);

    for (int i = 0; i < quantity; i++)
    {
        Fixture *fxi = new Fixture(m_doc);

        /* If we're adding more than one fixture,
           append a number to the end of the name */
        if (quantity > 1)
            fxi->setName(QString("%1 #%2").arg(name).arg(i + 1));
        else
            fxi->setName(name);
        fxi->setAddress(address + (i * channels) + (i * gap));
        fxi->setUniverse(uniIdx);
        fxi->setFixtureDefinition(fxiDef, fxiMode);

        m_doc->addFixture(fxi);
        emit newFixtureCreated(fxi->id(), xPos, yPos);
    }
    m_fixtureList.clear();
    m_fixtureList = m_doc->fixtures();
    emit fixturesCountChanged();

    return true;
}
开发者ID:ChrisLaurie,项目名称:qlcplus,代码行数:35,代码来源:fixturemanager.cpp

示例2: replaceFixtures

bool Doc::replaceFixtures(QList<Fixture*> newFixturesList)
{
    // Delete all fixture instances
    QListIterator <quint32> fxit(m_fixtures.keys());
    while (fxit.hasNext() == true)
    {
        Fixture* fxi = m_fixtures.take(fxit.next());
        delete fxi;
        m_fixturesListCacheUpToDate = false;
    }
    m_latestFixtureId = 0;
    m_addresses.clear();

    foreach(Fixture *fixture, newFixturesList)
    {
        quint32 id = fixture->id();
        // create a copy of the original cause remapping will
        // destroy it later
        Fixture *newFixture = new Fixture(this);
        newFixture->setID(id);
        newFixture->setName(fixture->name());
        newFixture->setAddress(fixture->address());
        newFixture->setUniverse(fixture->universe());
        if (fixture->fixtureDef() == NULL ||
            (fixture->fixtureDef()->manufacturer() == KXMLFixtureGeneric &&
             fixture->fixtureDef()->model() == KXMLFixtureGeneric))
        {
            newFixture->setChannels(fixture->channels());
        }
        else
        {
            QLCFixtureDef *def = fixtureDefCache()->fixtureDef(fixture->fixtureDef()->manufacturer(),
                                                               fixture->fixtureDef()->model());
            QLCFixtureMode *mode = NULL;
            if (def != NULL)
                mode = def->mode(fixture->fixtureMode()->name());
            newFixture->setFixtureDefinition(def, mode);
        }

        newFixture->setExcludeFadeChannels(fixture->excludeFadeChannels());
        m_fixtures.insert(id, newFixture);
        m_fixturesListCacheUpToDate = false;

        /* Patch fixture change signals thru Doc */
        connect(newFixture, SIGNAL(changed(quint32)),
                this, SLOT(slotFixtureChanged(quint32)));

        /* Keep track of fixture addresses */
        for (uint i = newFixture->universeAddress();
             i < newFixture->universeAddress() + newFixture->channels(); i++)
        {
            m_addresses[i] = id;
        }
        m_latestFixtureId = id;
    }
开发者ID:bjorkegeek,项目名称:qlcplus,代码行数:55,代码来源:doc.cpp

示例3: mode

void QLCFixtureDef_Test::mode()
{
    QLCFixtureDef* fd = new QLCFixtureDef();
    QLCFixtureMode* mode1 = new QLCFixtureMode(fd);
    mode1->setName("foo");
    fd->addMode(mode1);

    QLCFixtureMode* mode2 = new QLCFixtureMode(fd);
    mode2->setName("bar");
    fd->addMode(mode2);

    QLCFixtureMode* mode3 = new QLCFixtureMode(fd);
    mode3->setName("xyzzy");
    fd->addMode(mode3);

    QVERIFY(fd->mode("foo") == mode1);
    QVERIFY(fd->mode("bar") == mode2);
    QVERIFY(fd->mode("xyzzy") == mode3);
    QVERIFY(fd->mode("foobar") == NULL);

    delete fd;
}
开发者ID:Andersbakken,项目名称:qlc-svn,代码行数:22,代码来源:qlcfixturedef_test.cpp

示例4: init

void ChaserRunner_Test::init()
{
    QLCFixtureDef* def = m_doc->fixtureDefCache()->fixtureDef("Futurelight", "DJScan250");
    QVERIFY(def != NULL);
    QLCFixtureMode* mode = def->mode("Mode 1");
    QVERIFY(mode != NULL);

    Fixture* fxi = new Fixture(m_doc);
    QVERIFY(fxi != NULL);
    fxi->setFixtureDefinition(def, mode);
    fxi->setName("Test Fixture");
    fxi->setAddress(0);
    fxi->setUniverse(0);
    m_doc->addFixture(fxi);

    m_scene1 = new Scene(m_doc);
    m_scene1->setName("S1");
    QVERIFY(m_scene1 != NULL);
    for (quint32 i = 0; i < fxi->channels(); i++)
        m_scene1->setValue(fxi->id(), i, 255 - i);
    m_doc->addFunction(m_scene1);

    m_scene2 = new Scene(m_doc);
    m_scene2->setName("S2");
    QVERIFY(m_scene2 != NULL);
    for (quint32 i = 0; i < fxi->channels(); i++)
        m_scene2->setValue(fxi->id(), i, 127 - i);
    m_doc->addFunction(m_scene2);

    m_scene3 = new Scene(m_doc);
    m_scene3->setName("S3");
    QVERIFY(m_scene3 != NULL);
    for (quint32 i = 0; i < fxi->channels(); i++)
        m_scene3->setValue(fxi->id(), i, 0 + i);
    m_doc->addFunction(m_scene3);

    m_chaser = new Chaser(m_doc);
    m_chaser->addStep(ChaserStep(m_scene1->id()));
    m_chaser->addStep(ChaserStep(m_scene2->id()));
    m_chaser->addStep(ChaserStep(m_scene3->id()));
}
开发者ID:Jeija,项目名称:qlcplus,代码行数:41,代码来源:chaserrunner_test.cpp

示例5: loadXML

bool Fixture::loadXML(const QDomElement& root, Doc *doc,
                      const QLCFixtureDefCache* fixtureDefCache)
{
    QLCFixtureDef* fixtureDef = NULL;
    QLCFixtureMode* fixtureMode = NULL;
    QString manufacturer;
    QString model;
    QString modeName;
    QString name;
    quint32 id = Fixture::invalidId();
    quint32 universe = 0;
    quint32 address = 0;
    quint32 channels = 0;
    quint32 width = 0, height = 0;
    QList<int> excludeList;
    QList<int> forcedHTP;
    QList<int> forcedLTP;
    QList<quint32>modifierIndices;
    QList<ChannelModifier *>modifierPointers;

    if (root.tagName() != KXMLFixture)
    {
        qWarning() << Q_FUNC_INFO << "Fixture node not found";
        return false;
    }

    QDomNode node = root.firstChild();
    while (node.isNull() == false)
    {
        QDomElement tag = node.toElement();

        if (tag.tagName() == KXMLQLCFixtureDefManufacturer)
        {
            manufacturer = tag.text();
        }
        else if (tag.tagName() == KXMLQLCFixtureDefModel)
        {
            model = tag.text();
        }
        else if (tag.tagName() == KXMLQLCFixtureMode)
        {
            modeName = tag.text();
        }
        else if (tag.tagName() == KXMLQLCPhysicalDimensionsWeight)
        {
            width = tag.text().toUInt();
        }
        else if (tag.tagName() == KXMLQLCPhysicalDimensionsHeight)
        {
            height = tag.text().toUInt();
        }
        else if (tag.tagName() == KXMLFixtureID)
        {
            id = tag.text().toUInt();
        }
        else if (tag.tagName() == KXMLFixtureName)
        {
            name = tag.text();
        }
        else if (tag.tagName() == KXMLFixtureUniverse)
        {
            universe = tag.text().toInt();
        }
        else if (tag.tagName() == KXMLFixtureAddress)
        {
            address = tag.text().toInt();
        }
        else if (tag.tagName() == KXMLFixtureChannels)
        {
            channels = tag.text().toInt();
        }
        else if (tag.tagName() == KXMLFixtureExcludeFade)
        {
            QString list = tag.text();
            QStringList values = list.split(",");

            for (int i = 0; i < values.count(); i++)
                excludeList.append(values.at(i).toInt());
        }
        else if (tag.tagName() == KXMLFixtureForcedHTP)
        {
            QString list = tag.text();
            QStringList values = list.split(",");

            for (int i = 0; i < values.count(); i++)
                forcedHTP.append(values.at(i).toInt());
        }
        else if (tag.tagName() == KXMLFixtureForcedLTP)
        {
            QString list = tag.text();
            QStringList values = list.split(",");

            for (int i = 0; i < values.count(); i++)
                forcedLTP.append(values.at(i).toInt());
        }
        else if (tag.tagName() == KXMLFixtureChannelModifier)
        {
            if (tag.hasAttribute(KXMLFixtureChannelIndex) &&
                tag.hasAttribute(KXMLFixtureModifierName))
            {
//.........这里部分代码省略.........
开发者ID:offtools,项目名称:qlcplus,代码行数:101,代码来源:fixture.cpp

示例6: loader

Fixture* Fixture::loader(QDomDocument* doc, QDomElement* root)
{
	Fixture* fxi = NULL;
	QLCFixtureDef* fixtureDef = NULL;
	QLCFixtureMode* fixtureMode = NULL;
	QString manufacturer;
	QString model;
	QString modeName;
	QString name;
	t_fixture_id id = KNoID;
	t_channel universe = 0;
	t_channel address = 0;
	t_channel channels = 0;
	
	QDomNode node;
	QDomElement tag;
	QDomElement consoletag;
	
	Q_ASSERT(doc != NULL);
	Q_ASSERT(root != NULL);

	if (root->tagName() != KXMLFixture)
	{
		qWarning("Fixture instance node not found!");
		return NULL;
	}

	node = root->firstChild();
	while (node.isNull() == false)
	{
		tag = node.toElement();
		
		if (tag.tagName() == KXMLQLCFixtureDefManufacturer)
		{
			manufacturer = tag.text();
		}
		else if (tag.tagName() == KXMLQLCFixtureDefModel)
		{
			model = tag.text();
		}
		else if (tag.tagName() == KXMLQLCFixtureMode)
		{
			modeName = tag.text();
		}
		else if (tag.tagName() == KXMLFixtureID)
		{
			id = tag.text().toInt();
		}
		else if (tag.tagName() == KXMLFixtureName)
		{
			name = tag.text();
		}
		else if (tag.tagName() == KXMLFixtureUniverse)
		{
			universe = tag.text().toInt();
		}
		else if (tag.tagName() == KXMLFixtureAddress)
		{
			address = tag.text().toInt();
		}
		else if (tag.tagName() == KXMLFixtureChannels)
		{
			channels = tag.text().toInt();
		}
		else if (tag.tagName() == KXMLQLCFixtureConsole)
		{
			consoletag = tag;
		}
		else
		{
			qDebug("Unknown fixture instance tag: %s",
			       (const char*) tag.tagName());
		}
		
		node = node.nextSibling();
	}

	/* Find the given fixture definition */
	fixtureDef = _app->fixtureDef(manufacturer, model);
	if (fixtureDef == NULL)
	{
		qWarning("Fixture definition for [%s - %s] not found!",
			 (const char*) manufacturer, (const char*) model);
	}
	else
	{
		/* Find the given fixture mode */
		fixtureMode = fixtureDef->mode(modeName);
		if (fixtureMode == NULL)
		{
			qWarning("Fixture mode [%s] for [%s - %s] not found!",
				 (const char*) modeName,
				 (const char*) manufacturer,
				 (const char*) model);
		}
	}

	/* Number of channels */
	if (channels <= 0 || channels > KFixtureChannelsMax)
	{
//.........这里部分代码省略.........
开发者ID:speakman,项目名称:qlc,代码行数:101,代码来源:fixture.cpp


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