Exemplo n.º 1
0
bool VCClock::saveXML(QDomDocument* doc, QDomElement* vc_root)
{
    QDomElement root;

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

    /* VC Clock entry */
    root = doc->createElement(KXMLQLCVCClock);
    vc_root->appendChild(root);

    /* Type */
    ClockType type = clockType();
    root.setAttribute(KXMLQLCVCClockType, typeToString(type));
    if (type == Countdown)
    {
        root.setAttribute(KXMLQLCVCClockHours, getHours());
        root.setAttribute(KXMLQLCVCClockMinutes, getMinutes());
        root.setAttribute(KXMLQLCVCClockSeconds, getSeconds());
    }

    saveXMLCommon(doc, &root);

    /* Window state */
    saveXMLWindowState(doc, &root);

    /* Appearance */
    saveXMLAppearance(doc, &root);

    foreach(VCClockSchedule sch, schedules())
        sch.saveXML(doc, &root);

    return true;
}
Exemplo n.º 2
0
bool Script::saveXML(QDomDocument* doc, QDomElement* wksp_root)
{
    QDomElement root;
    QDomElement tag;
    QDomText text;

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

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

    /* Common attributes */
    saveXMLCommon(&root);

    /* Speed */
    saveXMLSpeed(doc, &root);

    /* Direction */
    saveXMLDirection(doc, &root);

    /* Run order */
    saveXMLRunOrder(doc, &root);

    /* Contents */
    tag = doc->createElement(KXMLQLCScriptContents);
    root.appendChild(tag);
    text = doc->createTextNode(QUrl::toPercentEncoding(data()));
    tag.appendChild(text);

    return true;
}
Exemplo n.º 3
0
bool Audio::saveXML(QXmlStreamWriter *doc)
{
    Q_ASSERT(doc != NULL);

    /* Function tag */
    doc->writeStartElement(KXMLQLCFunction);

    /* Common attributes */
    saveXMLCommon(doc);

    /* Speed */
    saveXMLSpeed(doc);

    doc->writeStartElement(KXMLQLCAudioSource);
    if (m_audioDevice.isEmpty() == false)
        doc->writeAttribute(KXMLQLCAudioDevice, m_audioDevice);

    doc->writeCharacters(m_doc->normalizeComponentPath(m_sourceFileName));

    doc->writeEndElement();

    /* End the <Function> tag */
    doc->writeEndElement();

    return true;
}
Exemplo n.º 4
0
bool Collection::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);

    /* Common attributes */
    saveXMLCommon(&root);

    /* Steps */
    foreach(QVariant fid, m_functions)
    {
        /* Step tag */
        tag = doc->createElement(KXMLQLCFunctionStep);
        root.appendChild(tag);

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

        /* Step Function ID */
        str.setNum(fid.toUInt());
        text = doc->createTextNode(str);
        tag.appendChild(text);
    }
Exemplo n.º 5
0
bool Video::saveXML(QDomDocument* doc, QDomElement* wksp_root)
{
    QDomElement root;
    QDomText text;

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

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

    /* Common attributes */
    saveXMLCommon(&root);

    /* Speed */
    saveXMLSpeed(doc, &root);

    QDomElement source = doc->createElement(KXMLQLCVideoSource);
    if (m_screen > 0)
        source.setAttribute(KXMLQLCVideoScreen, m_screen);
    if (m_fullscreen == true)
        source.setAttribute(KXMLQLCVideoFullscreen, true);

    if (m_sourceUrl.contains("://"))
        text = doc->createTextNode(m_sourceUrl);
    else
        text = doc->createTextNode(m_doc->normalizeComponentPath(m_sourceUrl));

    source.appendChild(text);
    root.appendChild(source);

    return true;
}
Exemplo n.º 6
0
bool Video::saveXML(QXmlStreamWriter *doc)
{
    Q_ASSERT(doc != NULL);

    /* Function tag */
    doc->writeStartElement(KXMLQLCFunction);

    /* Common attributes */
    saveXMLCommon(doc);

    /* Speed */
    saveXMLSpeed(doc);

    /* Playback mode */
    saveXMLRunOrder(doc);

    doc->writeStartElement(KXMLQLCVideoSource);
    if (m_screen > 0)
        doc->writeAttribute(KXMLQLCVideoScreen, QString::number(m_screen));
    if (m_fullscreen == true)
        doc->writeAttribute(KXMLQLCVideoFullscreen, "1");

    if (m_sourceUrl.contains("://"))
        doc->writeCharacters(m_sourceUrl);
    else
        doc->writeCharacters(m_doc->normalizeComponentPath(m_sourceUrl));

    doc->writeEndElement();

    /* End the <Function> tag */
    doc->writeEndElement();

    return true;
}
Exemplo n.º 7
0
bool Chaser::saveXML(QXmlStreamWriter *doc)
{
    Q_ASSERT(doc != NULL);

    /* Function tag */
    doc->writeStartElement(KXMLQLCFunction);

    /* Common attributes */
    saveXMLCommon(doc);

    /* Speed */
    saveXMLSpeed(doc);

    /* Direction */
    saveXMLDirection(doc);

    /* Run order */
    saveXMLRunOrder(doc);

    /* Speed modes */
    doc->writeStartElement(KXMLQLCChaserSpeedModes);
    doc->writeAttribute(KXMLQLCFunctionSpeedFadeIn, speedModeToString(fadeInMode()));
    doc->writeAttribute(KXMLQLCFunctionSpeedFadeOut, speedModeToString(fadeOutMode()));
    doc->writeAttribute(KXMLQLCFunctionSpeedDuration, speedModeToString(durationMode()));
    doc->writeEndElement();

    /* Steps */
    for (int i = 0; i < m_steps.count(); i++)
        m_steps.at(i).saveXML(doc, i, false);

    /* End the <Function> tag */
    doc->writeEndElement();

    return true;
}
Exemplo n.º 8
0
bool Chaser::saveXML(QDomDocument* doc, QDomElement* wksp_root)
{
    QDomElement root;
    //QDomText text;
    //QString str;

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

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

    /* Common attributes */
    saveXMLCommon(&root);

    /* Speed */
    saveXMLSpeed(doc, &root);

    /* Direction */
    saveXMLDirection(doc, &root);

    /* Run order */
    saveXMLRunOrder(doc, &root);

    /* Speed modes */
    QDomElement spd = doc->createElement(KXMLQLCChaserSpeedModes);
    spd.setAttribute(KXMLQLCFunctionSpeedFadeIn, speedModeToString(fadeInMode()));
    spd.setAttribute(KXMLQLCFunctionSpeedFadeOut, speedModeToString(fadeOutMode()));
    spd.setAttribute(KXMLQLCFunctionSpeedDuration, speedModeToString(durationMode()));
    root.appendChild(spd);

    if (m_isSequence == true)
    {
        QDomElement seq = doc->createElement(KXMLQLCChaserSequenceTag);
        seq.setAttribute(KXMLQLCChaserSequenceBoundScene, m_boundSceneID);
        seq.setAttribute(KXMLQLCChaserSequenceStartTime, m_startTime);
        seq.setAttribute(KXMLQLCChaserSequenceColor, m_color.name());
        if (isLocked())
            seq.setAttribute(KXMLQLCChaserSequenceLocked, m_locked);
        root.appendChild(seq);
    }

    /* Steps */
    int stepNumber = 0;
    QListIterator <ChaserStep> it(m_steps);
    while (it.hasNext() == true)
    {
        ChaserStep step(it.next());
        step.saveXML(doc, &root, stepNumber++, m_isSequence);
    }

    return true;
}
Exemplo n.º 9
0
bool RGBMatrix::saveXML(QXmlStreamWriter *doc)
{
    Q_ASSERT(doc != NULL);

    /* Function tag */
    doc->writeStartElement(KXMLQLCFunction);

    /* Common attributes */
    saveXMLCommon(doc);

    /* Speeds */
    saveXMLSpeed(doc);

    /* Direction */
    saveXMLDirection(doc);

    /* Run order */
    saveXMLRunOrder(doc);

    /* Algorithm */
    if (m_algorithm != NULL)
        m_algorithm->saveXML(doc);

    /* Dimmer Control */
    doc->writeTextElement(KXMLQLCRGBMatrixDimmerControl, QString::number(dimmerControl()));

    /* Start Color */
    doc->writeTextElement(KXMLQLCRGBMatrixStartColor, QString::number(startColor().rgb()));

    /* End Color */
    if (endColor().isValid())
    {
        doc->writeTextElement(KXMLQLCRGBMatrixEndColor, QString::number(endColor().rgb()));
    }

    /* Fixture Group */
    doc->writeTextElement(KXMLQLCRGBMatrixFixtureGroup, QString::number(fixtureGroup()));

    /* Properties */
    QHashIterator<QString, QString> it(m_properties);
    while(it.hasNext())
    {
        it.next();
        doc->writeStartElement(KXMLQLCRGBMatrixProperty);
        doc->writeAttribute(KXMLQLCRGBMatrixPropertyName, it.key());
        doc->writeAttribute(KXMLQLCRGBMatrixPropertyValue, it.value());
        doc->writeEndElement();
    }

    /* End the <Function> tag */
    doc->writeEndElement();

    return true;
}
Exemplo n.º 10
0
bool RGBMatrix::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);

    /* Common attributes */
    saveXMLCommon(&root);

    /* Speeds */
    saveXMLSpeed(doc, &root);

    /* Direction */
    saveXMLDirection(doc, &root);

    /* Run order */
    saveXMLRunOrder(doc, &root);

    /* Algorithm */
    if (m_algorithm != NULL)
        m_algorithm->saveXML(doc, &root);

    /* Start Color */
    tag = doc->createElement(KXMLQLCRGBMatrixStartColor);
    root.appendChild(tag);
    text = doc->createTextNode(QString::number(startColor().rgb()));
    tag.appendChild(text);

    /* End Color */
    if (endColor().isValid())
    {
        tag = doc->createElement(KXMLQLCRGBMatrixEndColor);
        root.appendChild(tag);
        text = doc->createTextNode(QString::number(endColor().rgb()));
        tag.appendChild(text);
    }

    /* Fixture Group */
    tag = doc->createElement(KXMLQLCRGBMatrixFixtureGroup);
    root.appendChild(tag);
    text = doc->createTextNode(QString::number(fixtureGroup()));
    tag.appendChild(text);

    return true;
}
Exemplo n.º 11
0
bool Chaser::saveXML(QXmlStreamWriter *doc)
{
    Q_ASSERT(doc != NULL);

    /* Function tag */
    doc->writeStartElement(KXMLQLCFunction);

    /* Common attributes */
    saveXMLCommon(doc);

    /* Speed */
    saveXMLSpeed(doc);

    /* Direction */
    saveXMLDirection(doc);

    /* Run order */
    saveXMLRunOrder(doc);

    /* Speed modes */
    doc->writeStartElement(KXMLQLCChaserSpeedModes);
    doc->writeAttribute(KXMLQLCFunctionSpeedFadeIn, speedModeToString(fadeInMode()));
    doc->writeAttribute(KXMLQLCFunctionSpeedFadeOut, speedModeToString(fadeOutMode()));
    doc->writeAttribute(KXMLQLCFunctionSpeedDuration, speedModeToString(durationMode()));
    doc->writeEndElement();

    if (m_isSequence == true)
    {
        doc->writeStartElement(KXMLQLCChaserSequenceTag);
        doc->writeAttribute(KXMLQLCChaserSequenceBoundScene, QString::number(m_boundSceneID));
        doc->writeEndElement();
    }

    /* Steps */
    int stepNumber = 0;
    QListIterator <ChaserStep> it(m_steps);
    while (it.hasNext() == true)
    {
        ChaserStep step(it.next());
        step.saveXML(doc, stepNumber++, m_isSequence);
    }

    /* End the <Function> tag */
    doc->writeEndElement();

    return true;
}
Exemplo n.º 12
0
bool VCLabel::saveXML(QDomDocument* doc, QDomElement* vc_root)
{
    QDomElement root;

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

    /* VC Label entry */
    root = doc->createElement(KXMLQLCVCLabel);
    vc_root->appendChild(root);

    saveXMLCommon(doc, &root);

    /* Window state */
    saveXMLWindowState(doc, &root);

    /* Appearance */
    saveXMLAppearance(doc, &root);

    return true;
}
Exemplo n.º 13
0
bool VCMatrix::saveXML(QDomDocument *doc, QDomElement *vc_root)
{
    QDomElement root;
    QDomElement tag;
    //QDomText text;
    QString str;

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

    /* VC button entry */
    root = doc->createElement(KXMLQLCVCMatrix);
    vc_root->appendChild(root);

    saveXMLCommon(doc, &root);

    /* Window state */
    saveXMLWindowState(doc, &root);

    /* Appearance */
    saveXMLAppearance(doc, &root);

    /* Function */
    tag = doc->createElement(KXMLQLCVCMatrixFunction);
    root.appendChild(tag);
    str.setNum(function());
    tag.setAttribute(KXMLQLCVCMatrixFunctionID, str);

    if (instantChanges() == true)
        tag.setAttribute(KXMLQLCVCMatrixInstantApply, "true");

    /* Slider External input */
    saveXMLInput(doc, &root);

    foreach(VCMatrixControl *control, customControls())
        control->saveXML(doc, &root);

    return true;
}
Exemplo n.º 14
0
bool Collection::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);

    /* Common attributes */
    saveXMLCommon(&root);

    /* Steps */
    QListIterator <quint32> it(m_functions);
    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;
}
Exemplo n.º 15
0
bool EFX::saveXML(QXmlStreamWriter *doc)
{
    Q_ASSERT(doc != NULL);

    /* Function tag */
    doc->writeStartElement(KXMLQLCFunction);

    /* Common attributes */
    saveXMLCommon(doc);

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

    /* Propagation mode */
    doc->writeTextElement(KXMLQLCEFXPropagationMode, propagationModeToString(m_propagationMode));

    /* Speeds */
    saveXMLSpeed(doc);
    /* Direction */
    saveXMLDirection(doc);
    /* Run order */
    saveXMLRunOrder(doc);

    /* Algorithm */
    doc->writeTextElement(KXMLQLCEFXAlgorithm, algorithmToString(algorithm()));
    /* Width */
    doc->writeTextElement(KXMLQLCEFXWidth, QString::number(width()));
    /* Height */
    doc->writeTextElement(KXMLQLCEFXHeight, QString::number(height()));
    /* Rotation */
    doc->writeTextElement(KXMLQLCEFXRotation, QString::number(rotation()));
    /* StartOffset */
    doc->writeTextElement(KXMLQLCEFXStartOffset, QString::number(startOffset()));
    /* IsRelative */
    doc->writeTextElement(KXMLQLCEFXIsRelative, QString::number(isRelative() ? 1 : 0));

    /********************************************
     * X-Axis
     ********************************************/
    doc->writeStartElement(KXMLQLCEFXAxis);
    doc->writeAttribute(KXMLQLCFunctionName, KXMLQLCEFXX);

    /* Offset */
    doc->writeTextElement(KXMLQLCEFXOffset, QString::number(xOffset()));
    /* Frequency */
    doc->writeTextElement(KXMLQLCEFXFrequency, QString::number(xFrequency()));
    /* Phase */
    doc->writeTextElement(KXMLQLCEFXPhase, QString::number(xPhase()));

    /* End the (X) <Axis> tag */
    doc->writeEndElement();

    /********************************************
     * Y-Axis
     ********************************************/
    doc->writeStartElement(KXMLQLCEFXAxis);
    doc->writeAttribute(KXMLQLCFunctionName, KXMLQLCEFXY);

    /* Offset */
    doc->writeTextElement(KXMLQLCEFXOffset, QString::number(yOffset()));
    /* Frequency */
    doc->writeTextElement(KXMLQLCEFXFrequency, QString::number(yFrequency()));
    /* Phase */
    doc->writeTextElement(KXMLQLCEFXPhase, QString::number(yPhase()));

    /* End the (Y) <Axis> tag */
    doc->writeEndElement();

    /* End the <Function> tag */
    doc->writeEndElement();

    return true;
}
Exemplo n.º 16
0
bool RGBMatrix::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);

    /* Common attributes */
    saveXMLCommon(&root);

    /* Speeds */
    saveXMLSpeed(doc, &root);

    /* Direction */
    saveXMLDirection(doc, &root);

    /* Run order */
    saveXMLRunOrder(doc, &root);

    /* Algorithm */
    if (m_algorithm != NULL)
        m_algorithm->saveXML(doc, &root);

    /* Dimmer Control */
    tag = doc->createElement(KXMLQLCRGBMatrixDimmerControl);
    root.appendChild(tag);
    text = doc->createTextNode(QString::number(dimmerControl()));
    tag.appendChild(text);

    /* Start Color */
    tag = doc->createElement(KXMLQLCRGBMatrixStartColor);
    root.appendChild(tag);
    text = doc->createTextNode(QString::number(startColor().rgb()));
    tag.appendChild(text);

    /* End Color */
    if (endColor().isValid())
    {
        tag = doc->createElement(KXMLQLCRGBMatrixEndColor);
        root.appendChild(tag);
        text = doc->createTextNode(QString::number(endColor().rgb()));
        tag.appendChild(text);
    }

    /* Fixture Group */
    tag = doc->createElement(KXMLQLCRGBMatrixFixtureGroup);
    root.appendChild(tag);
    text = doc->createTextNode(QString::number(fixtureGroup()));
    tag.appendChild(text);

    /* Properties */
    QHashIterator<QString, QString> it(m_properties);
    while(it.hasNext())
    {
        it.next();
        tag = doc->createElement(KXMLQLCRGBMatrixProperty);
        tag.setAttribute(KXMLQLCRGBMatrixPropertyName, it.key());
        tag.setAttribute(KXMLQLCRGBMatrixPropertyValue, it.value());
        root.appendChild(tag);
    }

    return true;
}
Exemplo n.º 17
0
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);

    /* Common attributes */
    saveXMLCommon(&root);

    /* 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);

    /* Speeds */
    saveXMLSpeed(doc, &root);

    /* Direction */
    saveXMLDirection(doc, &root);

    /* Run order */
    saveXMLRunOrder(doc, &root);

    /* Algorithm */
    tag = doc->createElement(KXMLQLCEFXAlgorithm);
    root.appendChild(tag);
    text = doc->createTextNode(algorithmToString(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);

    /* StartOffset */
    tag = doc->createElement(KXMLQLCEFXStartOffset);
    root.appendChild(tag);
    str.setNum(startOffset());
    text = doc->createTextNode(str);
    tag.appendChild(text);

    /* IsRelative */
    tag = doc->createElement(KXMLQLCEFXIsRelative);
    root.appendChild(tag);
    str.setNum(isRelative() ? 1 : 0);
    text = doc->createTextNode(str);
    tag.appendChild(text);

    /********************************************
     * 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;
}