use of electric.xml.Element in project blue by kunstmusik.
the class Send method loadFromXML.
public static Send loadFromXML(Element data) {
Send send = new Send(false);
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "sendChannel":
send.sendChannel = node.getTextString();
break;
case "level":
send.level = Double.parseDouble(node.getTextString());
break;
case "enabled":
send.enabled = Boolean.valueOf(node.getTextString()).booleanValue();
break;
case "parameter":
send.levelParameter = Parameter.loadFromXML(node);
send.levelParameter.addParameterListener(send);
send.params.add(send.levelParameter);
break;
}
}
if (send.params.size() == 0) {
send.levelParameter = new Parameter();
send.levelParameter.setName("Send Amount");
send.levelParameter.setMin(0.0f, false);
send.levelParameter.setMax(1.0f, false);
send.levelParameter.setValue(1.0f);
send.levelParameter.setResolution(new BigDecimal(-1.0f));
send.levelParameter.addParameterListener(send);
send.params.add(send.levelParameter);
}
return send;
}
use of electric.xml.Element in project blue by kunstmusik.
the class InversionProcessor 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 LineMultiplyProcessor 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("lineMultiplyString").setText(this.getLineMultiplyString());
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class InstrumentUtilities method getBasicXML.
public static Element getBasicXML(Instrument instr) {
Element retVal = new Element("instrument");
retVal.setAttribute("type", instr.getClass().getName());
retVal.addElement("name").setText(instr.getName());
retVal.addElement("comment").setText(instr.getComment());
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class PythonInstrument method loadFromXML.
public static Instrument loadFromXML(Element data) throws Exception {
PythonInstrument instr = new PythonInstrument();
InstrumentUtilities.initBasicFromXML(data, instr);
Elements elements = data.getElements();
while (elements.hasMoreElements()) {
Element node = elements.next();
String nodeName = node.getName();
switch(nodeName) {
case "globalOrc":
instr.setGlobalOrc(node.getTextString());
break;
case "globalSco":
instr.setGlobalSco(node.getTextString());
break;
case "instrumentText":
instr.setText(node.getTextString());
break;
case "opcodeList":
instr.opcodeList = OpcodeList.loadFromXML(node);
break;
}
}
return instr;
}
Aggregations