Search in sources :

Example 61 with Element

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

the class Beta method loadFromXML.

public static ProbabilityGenerator loadFromXML(Element data) {
    Beta retVal = new Beta();
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        switch(nodeName) {
            case "a":
                retVal.a = XMLUtilities.readDouble(node);
                break;
            case "b":
                retVal.b = XMLUtilities.readDouble(node);
                break;
            case "aTableEnabled":
                retVal.aTableEnabled = XMLUtilities.readBoolean(node);
                break;
            case "bTableEnabled":
                retVal.bTableEnabled = XMLUtilities.readBoolean(node);
                break;
            case "table":
                String tableId = node.getAttributeValue("tableId");
                switch(tableId) {
                    case "aTable":
                        retVal.aTable = Table.loadFromXML(node);
                        break;
                    case "bTable":
                        retVal.bTable = Table.loadFromXML(node);
                        break;
                }
                break;
        }
    }
    return retVal;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 62 with Element

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

the class Gaussian method saveAsXML.

@Override
public Element saveAsXML() {
    Element retVal = new Element("probabilityGenerator");
    retVal.setAttribute("type", getClass().getName());
    retVal.addElement(XMLUtilities.writeDouble("sigma", sigma));
    retVal.addElement(XMLUtilities.writeDouble("mu", mu));
    retVal.addElement(XMLUtilities.writeBoolean("sigmaTableEnabled", sigmaTableEnabled));
    retVal.addElement(XMLUtilities.writeBoolean("muTableEnabled", muTableEnabled));
    Element sigmaTableNode = sigmaTable.saveAsXML();
    sigmaTableNode.setAttribute("tableId", "sigmaTable");
    Element muTableNode = muTable.saveAsXML();
    muTableNode.setAttribute("tableId", "muTable");
    retVal.addElement(sigmaTableNode);
    retVal.addElement(muTableNode);
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 63 with Element

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

the class Uniform method saveAsXML.

@Override
public Element saveAsXML() {
    Element retVal = new Element("probabilityGenerator");
    retVal.setAttribute("type", getClass().getName());
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 64 with Element

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

the class PianoNote method saveAsXML.

public Element saveAsXML() {
    Element retVal = new Element("pianoNote");
    retVal.addElement("octave").setText(Integer.toString(octave));
    retVal.addElement("scaleDegree").setText(Integer.toString(scaleDegree));
    retVal.addElement("start").setText(Double.toString(start));
    retVal.addElement("duration").setText(Double.toString(duration));
    retVal.addElement("noteTemplate").setText(noteTemplate);
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 65 with Element

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

the class TrackList method saveAsXML.

public Element saveAsXML() {
    Element retVal = new Element("trackList");
    retVal.addElement(XMLUtilities.writeInt("steps", steps));
    for (Track tr : tracks) {
        retVal.addElement(tr.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