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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations