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


C++ Fixture::createConsole方法代码示例

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


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

示例1: loader


//.........这里部分代码省略.........
		{
			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)
	{
		qWarning("Fixture <%s> channels %d out of bounds (%d - %d)!",
			 (const char*) name, channels, 1, KFixtureChannelsMax);
		channels = 1;
	}

	/* Make sure that address is something sensible */
	if (address > 511 || address + (channels - 1) > 511)
	{
		qWarning("Fixture channel range %d - %d out of DMX " \
			 "bounds (%d - %d)!",
			 address + 1, address + channels, 1, 512);
		address = 0;
	}

	/* Make sure that universe is something sensible */
	if (universe > KUniverseCount)
	{
		qWarning("Fixture universe %d out of bounds (%d - %d)!",
			 universe, 0, KUniverseCount);
		universe = 0;
	}

	/* Check that we have a sensible ID, otherwise we can't continue */
	if (id < 0 || id > KFixtureArraySize)
	{
		qWarning("Fixture ID %d out of bounds (%d - %d)!",
			 id, 0, KFixtureArraySize);
		return NULL;
	}

	/* Create the fixture */
	if (fixtureDef != NULL && fixtureMode != NULL)
	{
		/* Create a normal fixture */
		fxi = new Fixture(fixtureDef, fixtureMode, address, universe,
				  name, id);
	}
	else
	{
		/* Create a generic fixture */
		fxi = new Fixture(address, universe, channels, name, id);
	}

	/* Insert the fixture to Doc's fixture array */
	if (_app->doc()->newFixture(fxi) == false)
	{
		delete fxi;
		fxi = NULL;
	}
	else
	{
		/* Load the fixture's console settings */
		if (consoletag.tagName() == KXMLQLCFixtureConsole)
		{
			if (fxi->createConsole() == true)
				fxi->m_console->loadXML(doc, &tag);
		}
	}

	return fxi;
}
开发者ID:speakman,项目名称:qlc,代码行数:101,代码来源:fixture.cpp


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