Search in sources :

Example 41 with Element

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

the class NoteProcessorChainMap method loadFromXML.

public static NoteProcessorChainMap loadFromXML(Element data) throws Exception {
    NoteProcessorChainMap map = new NoteProcessorChainMap();
    Elements npcNodes = data.getElements("npc");
    while (npcNodes.hasMoreElements()) {
        Element elem = npcNodes.next();
        String name = elem.getAttributeValue("name");
        NoteProcessorChain npc = NoteProcessorChain.loadFromXML(elem.getElement("noteProcessorChain"));
        map.put(name, npc);
    }
    return map;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 42 with Element

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

the class NoteProcessorChainMap method saveAsXML.

public Element saveAsXML() {
    Element retVal = new Element("noteProcessorChainMap");
    for (String name : this.keySet()) {
        NoteProcessorChain npc = this.getNoteProcessorChain(name);
        Element npcNode = new Element("npc");
        npcNode.setAttribute("name", name);
        npcNode.addElement(npc.saveAsXML());
        retVal.addElement(npcNode);
    }
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 43 with Element

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

the class PchInversionProcessor method saveAsXML.

/*
     * (non-Javadoc)
     * 
     * @see blue.noteProcessor.NoteProcessor#saveAsXML()
     */
@Override
public Element saveAsXML() {
    Element retVal = new Element("noteProcessor");
    retVal.setAttribute("type", this.getClass().getName());
    retVal.addElement("pfield").setText(this.getPfield());
    retVal.addElement("value").setText(this.getVal());
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 44 with Element

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

the class RandomAddProcessor method loadFromXML.

public static NoteProcessor loadFromXML(Element data) {
    RandomAddProcessor rap = new RandomAddProcessor();
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        switch(node.getName()) {
            case "pfield":
                rap.setPfield(node.getTextString());
                break;
            case "min":
                rap.setMin(node.getTextString());
                break;
            case "max":
                rap.setMax(node.getTextString());
                break;
            case "seedUsed":
                rap.setSeedUsed(node.getTextString());
                break;
            case "seed":
                rap.setSeed(node.getTextString());
                break;
        }
    }
    return rap;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 45 with Element

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

the class RandomAddProcessor method saveAsXML.

/*
     * (non-Javadoc)
     * 
     * @see blue.noteProcessor.NoteProcessor#saveAsXML()
     */
@Override
public Element saveAsXML() {
    Element retVal = new Element("noteProcessor");
    retVal.setAttribute("type", this.getClass().getName());
    retVal.addElement("pfield").setText(this.getPfield());
    retVal.addElement("min").setText(this.getMin());
    retVal.addElement("max").setText(this.getMax());
    retVal.addElement("seedUsed").setText(this.getSeedUsed());
    retVal.addElement("seed").setText(this.getSeed());
    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