void Scene::copyFrom(Scene* sc, t_fixture_id to) { Q_ASSERT(sc != NULL); Function::setName(sc->name()); Function::setBus(sc->busID()); setFixture(to); if (m_values) delete [] m_values; m_values = new SceneValue[m_channels]; for (t_channel ch = 0; ch < m_channels; ch++) { m_values[ch].value = sc->m_values[ch].value; m_values[ch].type = sc->m_values[ch].type; } }
bool EFXFixture::loadXML(const QDomElement* root) { QDomElement tag; QDomNode node; Q_ASSERT(root != NULL); if (root->tagName() != KXMLQLCEFXFixture) { qWarning("EFX Fixture node not found!"); return false; } /* New file format contains sub tags */ node = root->firstChild(); while (node.isNull() == false) { tag = node.toElement(); if (tag.tagName() == KXMLQLCEFXFixtureID) { /* Fixture ID */ setFixture(tag.text().toInt()); } else if (tag.tagName() == KXMLQLCEFXFixtureDirection) { /* Direction */ Function::Direction dir; dir = Function::stringToDirection(tag.text()); setDirection(dir); } else { qWarning() << "Unknown EFX Fixture tag:" << tag.tagName(); } node = node.nextSibling(); } return true; }
bool VCXYPadFixture::loadXML(const QDomElement* root) { QDomNode node; QDomElement tag; QString axis; QString min; QString max; QString rev; Q_ASSERT(root != NULL); if (root->tagName() != KXMLQLCVCXYPadFixture) { qWarning() << "XYPad Fixture node not found"; return false; } /* Fixture ID */ setFixture(root->attribute(KXMLQLCVCXYPadFixtureID).toInt()); /* Children */ node = root->firstChild(); while (node.isNull() == false) { tag = node.toElement(); if (tag.tagName() == KXMLQLCVCXYPadFixtureAxis) { axis = tag.attribute(KXMLQLCVCXYPadFixtureAxisID); min = tag.attribute(KXMLQLCVCXYPadFixtureAxisLowLimit); max = tag.attribute(KXMLQLCVCXYPadFixtureAxisHighLimit); rev = tag.attribute(KXMLQLCVCXYPadFixtureAxisReverse); if (axis == KXMLQLCVCXYPadFixtureAxisX) { if (rev == KXMLQLCTrue) setX(min.toDouble(), max.toDouble(), true); else setX(min.toDouble(), max.toDouble(), false); } else if (axis == KXMLQLCVCXYPadFixtureAxisY) { if (rev == KXMLQLCTrue) setY(min.toDouble(), max.toDouble(), true); else setY(min.toDouble(), max.toDouble(), false); } else { qWarning() << "Unknown XYPad axis" << axis; } } else { qDebug() << "Unknown XY Pad tag:" << tag.tagName(); } node = node.nextSibling(); } return true; }