コード例 #1
0
ファイル: scene.cpp プロジェクト: speakman/qlc
bool Scene::saveXML(QDomDocument* doc, QDomElement* wksp_root)
{
	QDomElement root;
	QDomElement tag;
	QDomText text;
	QString str;

	Q_ASSERT(doc != NULL);
	Q_ASSERT(wksp_root != NULL);

	/* Function tag */
	root = doc->createElement(KXMLQLCFunction);
	wksp_root->appendChild(root);

	root.setAttribute(KXMLQLCFunctionID, id());
	root.setAttribute(KXMLQLCFunctionType, Function::typeToString(type()));
	root.setAttribute(KXMLQLCFunctionName, name());

	/* Speed bus */
	tag = doc->createElement(KXMLQLCBus);
	root.appendChild(tag);
	tag.setAttribute(KXMLQLCBusRole, KXMLQLCBusFade);
	str.setNum(busID());
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Scene contents */
	QListIterator <SceneValue> it(m_values);
	while (it.hasNext() == true)
		it.next().saveXML(doc, &root);

	return true;
}
コード例 #2
0
ファイル: vcdockslider.cpp プロジェクト: speakman/qlc
bool VCDockSlider::saveXML(QDomDocument* doc, QDomElement* da_root)
{
	QDomElement root;
	QString str;

	Q_ASSERT(doc != NULL);
	Q_ASSERT(da_root != NULL);

	/* Slider entry */
	root = doc->createElement(KXMLQLCVCDockSlider);
	da_root->appendChild(root);

	/* Bus ID */
	str.setNum(busID());
	root.setAttribute(KXMLQLCVCDockSliderBus, str);

	/* Bus low limit */
	str.setNum(m_busLowLimit);
	root.setAttribute(KXMLQLCVCDockSliderBusLowLimit, str);

	/* Bus high limit */
	str.setNum(m_busHighLimit);
	root.setAttribute(KXMLQLCVCDockSliderBusHighLimit, str);

	return true;
}
コード例 #3
0
ファイル: chaser.cpp プロジェクト: Andersbakken/qlc-svn
void Chaser::arm()
{
    Doc* doc = qobject_cast <Doc*> (parent());
    Q_ASSERT(doc != NULL);
    m_runner = new ChaserRunner(doc, stepFunctions(), busID(), direction(), runOrder());
    resetElapsed();
}
コード例 #4
0
ファイル: chaser.cpp プロジェクト: speakman/qlc
// Save this function to an XML document
bool Chaser::saveXML(QDomDocument* doc, QDomElement* wksp_root)
{
	QDomElement root;
	QDomElement tag;
	QDomText text;
	QString str;
	int i = 0;
	
	Q_ASSERT(doc != NULL);
	Q_ASSERT(wksp_root != NULL);

	/* Function tag */
	root = doc->createElement(KXMLQLCFunction);
	wksp_root->appendChild(root);

	root.setAttribute(KXMLQLCFunctionID, id());
	root.setAttribute(KXMLQLCFunctionType, Function::typeToString(m_type));
	root.setAttribute(KXMLQLCFunctionFixture, fixture());
	root.setAttribute(KXMLQLCFunctionName, name());

	/* Speed bus */
	tag = doc->createElement(KXMLQLCBus);
	root.appendChild(tag);
	tag.setAttribute(KXMLQLCBusRole, KXMLQLCBusHold);
	str.setNum(busID());
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Direction */
	tag = doc->createElement(KXMLQLCFunctionDirection);
	root.appendChild(tag);
	text = doc->createTextNode(Function::directionToString(m_direction));
	tag.appendChild(text);

	/* Run order */
	tag = doc->createElement(KXMLQLCFunctionRunOrder);
	root.appendChild(tag);
	text = doc->createTextNode(Function::runOrderToString(m_runOrder));
	tag.appendChild(text);

	/* Steps */
	QValueList <t_function_id>::iterator it;
	for (it = m_steps.begin(); it != m_steps.end(); ++it)
	{
		/* Step tag */
		tag = doc->createElement(KXMLQLCFunctionStep);
		root.appendChild(tag);

		/* Step number */
		tag.setAttribute(KXMLQLCFunctionNumber, i++);

		/* Step Function ID */
		str.setNum(*it);
		text = doc->createTextNode(str);
		tag.appendChild(text);
	}

	return true;
}
コード例 #5
0
ファイル: shuffle.cpp プロジェクト: speakman/qlc
bool Shuffle::saveXML(QDomDocument* doc, QDomElement* wksp_root)
{
	QDomElement root;
	QDomElement tag;
	QDomText text;
	QString str;
	int i = 0;

	Q_ASSERT(doc != NULL);
	Q_ASSERT(wksp_root != NULL);

	/* Function tag */
	root = doc->createElement(KXMLQLCFunction);
	wksp_root->appendChild(root);

	root.setAttribute(KXMLQLCFunctionID, id());
	root.setAttribute(KXMLQLCFunctionType, Function::typeToString(type()));
	root.setAttribute(KXMLQLCFunctionName, name());

	/* Speed bus */
	tag = doc->createElement(KXMLQLCBus);
	root.appendChild(tag);
	tag.setAttribute(KXMLQLCBusRole, KXMLQLCBusHold);
	str.setNum(busID());
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Direction */
	tag = doc->createElement(KXMLQLCFunctionDirection);
	root.appendChild(tag);
	text = doc->createTextNode(Function::directionToString(m_direction));
	tag.appendChild(text);

	/* Run order */
	tag = doc->createElement(KXMLQLCFunctionRunOrder);
	root.appendChild(tag);
	text = doc->createTextNode(Function::runOrderToString(m_runOrder));
	tag.appendChild(text);

	/* Steps */
	QListIterator <t_function_id> it(*sceneSteps());
	while (it.hasNext() == true)
	{
		/* Step tag */
		tag = doc->createElement(KXMLQLCFunctionStep);
		root.appendChild(tag);

		/* Step number */
		tag.setAttribute(KXMLQLCFunctionNumber, i++);

		/* Step Function ID */
		str.setNum(it.next());
		text = doc->createTextNode(str);
		tag.appendChild(text);
	}

	return true;
}
コード例 #6
0
ファイル: scene.cpp プロジェクト: speakman/qlc
// Save this function to an XML document
bool Scene::saveXML(QDomDocument* doc, QDomElement* wksp_root)
{
	Fixture* fxi = NULL;
	QDomElement root;
	QDomElement tag;
	QDomText text;
	QString str;
	
	Q_ASSERT(doc != NULL);
	Q_ASSERT(wksp_root != NULL);

	fxi = _app->doc()->fixture(m_fixture);
	Q_ASSERT(fxi != NULL);

	/* Function tag */
	root = doc->createElement(KXMLQLCFunction);
	wksp_root->appendChild(root);

	root.setAttribute(KXMLQLCFunctionID, id());
	root.setAttribute(KXMLQLCFunctionType, Function::typeToString(m_type));
	root.setAttribute(KXMLQLCFunctionName, name());
	root.setAttribute(KXMLQLCFunctionFixture, fixture());

	/* Speed bus */
	tag = doc->createElement(KXMLQLCBus);
	root.appendChild(tag);
	tag.setAttribute(KXMLQLCBusRole, KXMLQLCBusFade);
	str.setNum(busID());
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Scene contents */
	for (t_channel i = 0; i < fxi->channels(); i++)
	{
		/* Value tag */
		tag = doc->createElement(KXMLQLCFunctionValue);
		
		/* Value type & channel */
		tag.setAttribute(KXMLQLCFunctionChannel, i);
		tag.setAttribute(KXMLQLCFunctionValueType, valueTypeString(i));
		root.appendChild(tag);

		/* Value contents */
		str.setNum(m_values[i].value);
		text = doc->createTextNode(str);
		tag.appendChild(text);
	}
}
コード例 #7
0
/**
 * Save the function's contents to an XML document
 *
 * @param doc The QDomDocument to save to
 */
bool EFX::saveXML(QDomDocument* doc, QDomElement* wksp_root)
{
	QDomElement root;
	QDomElement tag;
	QDomElement subtag;
	QDomText text;
	QString str;

	Q_ASSERT(doc != NULL);
	Q_ASSERT(wksp_root != NULL);

	/* Function tag */
	root = doc->createElement(KXMLQLCFunction);
	wksp_root->appendChild(root);

	root.setAttribute(KXMLQLCFunctionID, id());
	root.setAttribute(KXMLQLCFunctionType, Function::typeToString(m_type));
	root.setAttribute(KXMLQLCFunctionName, name());

	/* Fixtures */
	QListIterator <EFXFixture*> it(m_fixtures);
	while (it.hasNext() == true)
		it.next()->saveXML(doc, &root);

	/* Propagation mode */
	tag = doc->createElement(KXMLQLCEFXPropagationMode);
	root.appendChild(tag);
	text = doc->createTextNode(propagationModeToString(m_propagationMode));
	tag.appendChild(text);

	/* Speed bus */
	tag = doc->createElement(KXMLQLCBus);
	root.appendChild(tag);
	tag.setAttribute(KXMLQLCBusRole, KXMLQLCBusFade);
	str.setNum(busID());
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Direction */
	tag = doc->createElement(KXMLQLCFunctionDirection);
	root.appendChild(tag);
	text = doc->createTextNode(Function::directionToString(m_direction));
	tag.appendChild(text);

	/* Run order */
	tag = doc->createElement(KXMLQLCFunctionRunOrder);
	root.appendChild(tag);
	text = doc->createTextNode(Function::runOrderToString(m_runOrder));
	tag.appendChild(text);

	/* Algorithm */
	tag = doc->createElement(KXMLQLCEFXAlgorithm);
	root.appendChild(tag);
	text = doc->createTextNode(algorithm());
	tag.appendChild(text);

	/* Width */
	tag = doc->createElement(KXMLQLCEFXWidth);
	root.appendChild(tag);
	str.setNum(width());
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Height */
	tag = doc->createElement(KXMLQLCEFXHeight);
	root.appendChild(tag);
	str.setNum(height());
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Rotation */
	tag = doc->createElement(KXMLQLCEFXRotation);
	root.appendChild(tag);
	str.setNum(rotation());
	text = doc->createTextNode(str);
	tag.appendChild(text);

	/* Start function */
	tag = doc->createElement(KXMLQLCEFXStartScene);
	root.appendChild(tag);
	str.setNum(startScene());
	text = doc->createTextNode(str);
	tag.appendChild(text);
	if (startSceneEnabled() == true)
		tag.setAttribute(KXMLQLCFunctionEnabled, KXMLQLCTrue);
	else
		tag.setAttribute(KXMLQLCFunctionEnabled, KXMLQLCFalse);

	/* Stop function */
	tag = doc->createElement(KXMLQLCEFXStopScene);
	root.appendChild(tag);
	str.setNum(stopScene());
	text = doc->createTextNode(str);
	tag.appendChild(text);
	if (stopSceneEnabled() == true)
		tag.setAttribute(KXMLQLCFunctionEnabled, KXMLQLCTrue);
	else
		tag.setAttribute(KXMLQLCFunctionEnabled, KXMLQLCFalse);

	/********************************************
	 * X-Axis 
	 ********************************************/
	tag = doc->createElement(KXMLQLCEFXAxis);
	root.appendChild(tag);
	tag.setAttribute(KXMLQLCFunctionName, KXMLQLCEFXX);

	/* Offset */
	subtag = doc->createElement(KXMLQLCEFXOffset);
	tag.appendChild(subtag);
	str.setNum(xOffset());
	text = doc->createTextNode(str);
	subtag.appendChild(text);

        /* Frequency */
	subtag = doc->createElement(KXMLQLCEFXFrequency);
	tag.appendChild(subtag);
	str.setNum(xFrequency());
	text = doc->createTextNode(str);
	subtag.appendChild(text);

        /* Phase */
	subtag = doc->createElement(KXMLQLCEFXPhase);
	tag.appendChild(subtag);
	str.setNum(xPhase());
	text = doc->createTextNode(str);
	subtag.appendChild(text);

	/********************************************
	 * Y-Axis 
	 ********************************************/
	tag = doc->createElement(KXMLQLCEFXAxis);
	root.appendChild(tag);
	tag.setAttribute(KXMLQLCFunctionName, KXMLQLCEFXY);

	/* Offset */
	subtag = doc->createElement(KXMLQLCEFXOffset);
	tag.appendChild(subtag);
	str.setNum(yOffset());
	text = doc->createTextNode(str);
	subtag.appendChild(text);

	/* Frequency */
	subtag = doc->createElement(KXMLQLCEFXFrequency);
	tag.appendChild(subtag);
	str.setNum(yFrequency());
	text = doc->createTextNode(str);
	subtag.appendChild(text);

        /* Phase */
	subtag = doc->createElement(KXMLQLCEFXPhase);
	tag.appendChild(subtag);
	str.setNum(yPhase());
	text = doc->createTextNode(str);
	subtag.appendChild(text);

	return true;
}