Search in sources :

Example 36 with Elements

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

the class Linear method loadFromXML.

public static ProbabilityGenerator loadFromXML(Element data) {
    Linear retVal = new Linear();
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        if (nodeName.equals("direction")) {
            retVal.direction = XMLUtilities.readInt(node);
        }
    }
    return retVal;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 37 with Elements

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

the class Weibull method loadFromXML.

public static ProbabilityGenerator loadFromXML(Element data) {
    Weibull retVal = new Weibull();
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        switch(nodeName) {
            case "s":
                retVal.s = XMLUtilities.readDouble(node);
                break;
            case "t":
                retVal.t = XMLUtilities.readDouble(node);
                break;
            case "sTableEnabled":
                retVal.sTableEnabled = XMLUtilities.readBoolean(node);
                break;
            case "tTableEnabled":
                retVal.tTableEnabled = XMLUtilities.readBoolean(node);
                break;
            case "table":
                String tableId = node.getAttributeValue("tableId");
                switch(tableId) {
                    case "sTable":
                        retVal.sTable = Table.loadFromXML(node);
                        break;
                    case "tTable":
                        retVal.tTable = Table.loadFromXML(node);
                        break;
                }
                break;
        }
    }
    return retVal;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 38 with Elements

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

the class JMask method loadFromXML.

public static SoundObject loadFromXML(Element data, Map<String, Object> objRefMap) throws Exception {
    JMask jmask = new JMask();
    SoundObjectUtilities.initBasicFromXML(data, jmask);
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        switch(nodeName) {
            case "field":
                jmask.setField(Field.loadFromXML(node));
                break;
            case "seed":
                jmask.setSeed(Long.parseLong(node.getTextString()));
                break;
            case "seedUsed":
                jmask.setSeedUsed(Boolean.parseBoolean(node.getTextString()));
                break;
        }
    }
    return jmask;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 39 with Elements

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

the class LineObject method loadFromXML.

/* SERIALIZATION */
public static SoundObject loadFromXML(Element data, Map<String, Object> objRefMap) throws Exception {
    LineObject lObj = new LineObject();
    SoundObjectUtilities.initBasicFromXML(data, lObj);
    Elements lines = data.getElements();
    int counter = 0;
    while (lines.hasMoreElements()) {
        Element node = lines.next();
        if (node.getName().equals("line")) {
            Line l = Line.loadFromXML(node);
            lObj.getLines().add(l);
            if (l.getColor() == null) {
                l.setColor(LineColors.getColor(counter));
            }
            counter++;
        }
    }
    return lObj;
}
Also used : Line(blue.components.lines.Line) Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 40 with Elements

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

the class PatternObject method loadFromXML.

/* SERIALIZATION */
public static SoundObject loadFromXML(Element data, Map<String, Object> objRefMap) throws Exception {
    PatternObject pattern = new PatternObject();
    SoundObjectUtilities.initBasicFromXML(data, pattern);
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        switch(nodeName) {
            case "beats":
                pattern.setBeats(Integer.parseInt(node.getTextString()));
                break;
            case "subDivisions":
                pattern.setSubDivisions(Integer.parseInt(node.getTextString()));
                break;
            case "patterns":
                Elements patternNodes = node.getElements();
                while (patternNodes.hasMoreElements()) {
                    Pattern p = Pattern.loadFromXML(patternNodes.next());
                    pattern.addPattern(p);
                }
                break;
        }
    }
    return pattern;
}
Also used : Pattern(blue.soundObject.pattern.Pattern) Element(electric.xml.Element) Elements(electric.xml.Elements)

Aggregations

Elements (electric.xml.Elements)131 Element (electric.xml.Element)120 Document (electric.xml.Document)12 BigDecimal (java.math.BigDecimal)10 Vector (java.util.Vector)10 File (java.io.File)4 SoundObject (blue.soundObject.SoundObject)3 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 ParseException (electric.xml.ParseException)3 ArrayList (java.util.ArrayList)3 ParameterList (blue.automation.ParameterList)2 Line (blue.components.lines.Line)2 Color (java.awt.Color)2 IOException (java.io.IOException)2 Font (javafx.scene.text.Font)2 LiveObject (blue.blueLive.LiveObject)1 LiveObjectBins (blue.blueLive.LiveObjectBins)1