use of electric.xml.Element in project blue by kunstmusik.
the class NoteProcessorChain method loadFromXML.
public static NoteProcessorChain loadFromXML(Element data) throws Exception {
NoteProcessorChain npc = new NoteProcessorChain();
Elements nProcNodes = data.getElements("noteProcessor");
while (nProcNodes.hasMoreElements()) {
Element elem = nProcNodes.next();
Object obj = ObjectUtilities.loadFromXML(elem);
npc.add((NoteProcessor) obj);
}
return npc;
}
use of electric.xml.Element in project blue by kunstmusik.
the class RandomMultiplyProcessor 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;
}
use of electric.xml.Element in project blue by kunstmusik.
the class TuningProcessor method loadFromXML.
public static NoteProcessor loadFromXML(Element data) {
TuningProcessor tp = new TuningProcessor();
Elements nodes = data.getElements();
double baseFreq = -1;
while (nodes.hasMoreElements()) {
Element node = nodes.next();
switch(node.getName()) {
case "baseFrequency":
baseFreq = Double.parseDouble(node.getTextString());
break;
case "pfield":
tp.setPfield(node.getTextString());
break;
case "scale":
Scale scale;
if (node.getElements().size() == 0) {
String scaleDir = BlueSystem.getUserConfigurationDirectory() + File.separator + "scl";
String scalePath = scaleDir + File.separator + node.getTextString();
File scaleFile = new File(scalePath);
scale = Scale.loadScale(scaleFile);
} else {
scale = Scale.loadFromXML(node);
}
tp.setScale(scale);
break;
}
}
if (baseFreq > 0) {
tp.getScale().setBaseFrequency(baseFreq);
}
// tp.setFileName(data.getElement("fileName").getTextString());
return tp;
}
use of electric.xml.Element in project blue by kunstmusik.
the class BlueX7 method saveAsXML.
/*
* (non-Javadoc)
*
* @see blue.orchestra.Instrument#saveAsXML()
*/
@Override
public Element saveAsXML() {
Element retVal = InstrumentUtilities.getBasicXML(this);
retVal.addElement(algorithmCommon.saveAsXML());
retVal.addElement(lfo.saveAsXML());
for (int i = 0; i < operators.length; i++) {
retVal.addElement(operators[i].saveAsXML());
}
for (int i = 0; i < peg.length; i++) {
retVal.addElement(peg[i].saveAsXML());
}
retVal.addElement("csoundPostCode").setText(csoundPostCode);
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class EffectsChain method loadFromXML.
public static EffectsChain loadFromXML(Element data) throws Exception {
EffectsChain chain = new EffectsChain();
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "effect":
chain.addEffect(Effect.loadFromXML(node));
break;
case "send":
chain.addSend(Send.loadFromXML(node));
break;
}
}
return chain;
}
Aggregations