Search in sources :

Example 16 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class BSBGroup method saveAsXML.

@Override
public Element saveAsXML() {
    Element retVal = super.getBasicXML(this);
    retVal.addElement("groupName").setText(getGroupName());
    retVal.addElement("backgroundColor").setText(getBackgroundColor().toString());
    retVal.addElement("borderColor").setText(getBorderColor().toString());
    retVal.addElement("labelTextColor").setText(getLabelTextColor().toString());
    retVal.addElement(XMLUtilities.writeBoolean("titleEnabled", isTitleEnabled()));
    retVal.addElement("width").setText(Integer.toString(getWidth()));
    retVal.addElement("height").setText(Integer.toString(getHeight()));
    // retVal.setAttribute("editEnabled", Boolean.toString(isEditEnabled()));
    for (BSBObject bsbObj : interfaceItems) {
        retVal.addElement(bsbObj.saveAsXML());
    }
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 17 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class BSBHSlider method saveAsXML.

/*
     * (non-Javadoc)
     * 
     * @see blue.orchestra.blueSynthBuilder.BlueSynthBuilderObject#saveAsXML()
     */
@Override
public Element saveAsXML() {
    Element retVal = getBasicXML(this);
    retVal.setAttribute("version", "2");
    retVal.addElement("minimum").setText(Double.toString(getMinimum()));
    retVal.addElement("maximum").setText(Double.toString(getMaximum()));
    retVal.addElement("bdresolution").setText(getResolution().toString());
    retVal.addElement("value").setText(Double.toString(getValue()));
    retVal.addElement("sliderWidth").setText(Integer.toString(getSliderWidth()));
    retVal.addElement(XMLUtilities.writeBoolean("randomizable", isRandomizable()));
    retVal.addElement(XMLUtilities.writeBoolean("valueDisplayEnabled", isValueDisplayEnabled()));
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 18 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class BSBHSlider method loadFromXML.

public static BSBObject loadFromXML(Element data) {
    BSBHSlider slider = new BSBHSlider();
    double minVal = 0.0;
    double maxVal = 1.0;
    double val = 0.0;
    BigDecimal res = new BigDecimal("0.1");
    initBasicFromXML(data, slider);
    String verString = data.getAttributeValue("version");
    int version = (verString == null) ? 1 : Integer.parseInt(verString);
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        final String nodeText = node.getTextString();
        switch(nodeName) {
            case "minimum":
                minVal = Double.parseDouble(nodeText);
                break;
            case "maximum":
                maxVal = Double.parseDouble(nodeText);
                break;
            case "resolution":
                res = new BigDecimal(Double.parseDouble(nodeText)).setScale(5, RoundingMode.HALF_UP).stripTrailingZeros();
                break;
            case "bdresolution":
                res = new BigDecimal(nodeText);
                break;
            case "value":
                val = Double.parseDouble(nodeText);
                break;
            case "sliderWidth":
                slider.setSliderWidth(Integer.parseInt(nodeText));
                break;
            case "randomizable":
                slider.setRandomizable(XMLUtilities.readBoolean(node));
                break;
            case "valueDisplayEnabled":
                slider.setValueDisplayEnabled(XMLUtilities.readBoolean(node));
                break;
        }
    }
    slider.setValueProperty(new ClampedValue(minVal, maxVal, val, res));
    return slider;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements) BigDecimal(java.math.BigDecimal)

Example 19 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class BlueSynthBuilder method saveAsXML.

@Override
public Element saveAsXML() {
    Element retVal = InstrumentUtilities.getBasicXML(this);
    retVal.setAttribute("editEnabled", Boolean.toString(editEnabled));
    retVal.addElement("globalOrc").setText(this.getGlobalOrc());
    retVal.addElement("globalSco").setText(this.getGlobalSco());
    retVal.addElement("instrumentText").setText(this.getInstrumentText());
    retVal.addElement("alwaysOnInstrumentText").setText(this.getAlwaysOnInstrumentText());
    retVal.addElement(graphicInterface.saveAsXML());
    retVal.addElement(parameterList.saveAsXML());
    retVal.addElement(presetGroup.saveAsXML());
    retVal.addElement(opcodeList.saveAsXML());
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 20 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class GenericInstrument method saveAsXML.

/*
     * (non-Javadoc)
     * 
     * @see blue.orchestra.Instrument#saveAsXML()
     */
@Override
public Element saveAsXML() {
    Element retVal = InstrumentUtilities.getBasicXML(this);
    retVal.addElement("globalOrc").setText(this.getGlobalOrc());
    retVal.addElement("globalSco").setText(this.getGlobalSco());
    retVal.addElement("instrumentText").setText(this.getText());
    retVal.addElement(opcodeList.saveAsXML());
    return retVal;
}
Also used : Element(electric.xml.Element)

Aggregations

Element (electric.xml.Element)310 Elements (electric.xml.Elements)120 Document (electric.xml.Document)22 Vector (java.util.Vector)14 Iterator (java.util.Iterator)12 File (java.io.File)10 BigDecimal (java.math.BigDecimal)10 IOException (java.io.IOException)8 SoundObject (blue.soundObject.SoundObject)7 ParseException (electric.xml.ParseException)7 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)4 EffectOption (blue.tools.blueShare.effects.EffectOption)3 InstrumentOption (blue.tools.blueShare.instruments.InstrumentOption)3 SoundObjectOption (blue.tools.blueShare.soundObjects.SoundObjectOption)3 OpcodeList (blue.udo.OpcodeList)3 Test (org.junit.Test)3 ParameterList (blue.automation.ParameterList)2 LiveObject (blue.blueLive.LiveObject)2 LiveObjectBins (blue.blueLive.LiveObjectBins)2 Line (blue.components.lines.Line)2