use of electric.xml.Element in project blue by kunstmusik.
the class Mask method loadFromXML.
public static Mask loadFromXML(Element data) {
Mask retVal = new Mask();
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "table":
Table t = Table.loadFromXML(node);
String tabInstance = node.getAttributeValue("tableId");
switch(tabInstance) {
case "highTable":
retVal.highTable = t;
break;
case "lowTable":
retVal.lowTable = t;
break;
}
break;
case "highTableEnabled":
retVal.highTableEnabled = Boolean.valueOf(node.getTextString()).booleanValue();
break;
case "lowTableEnabled":
retVal.lowTableEnabled = Boolean.valueOf(node.getTextString()).booleanValue();
break;
case "low":
retVal.low = Double.parseDouble(node.getTextString());
break;
case "high":
retVal.high = Double.parseDouble(node.getTextString());
break;
case "mapValue":
retVal.mapValue = Double.parseDouble(node.getTextString());
break;
case "enabled":
retVal.enabled = Boolean.valueOf(node.getTextString()).booleanValue();
break;
}
}
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class Oscillator method saveAsXML.
@Override
public Element saveAsXML() {
Element retVal = new Element("generator");
retVal.setAttribute("type", getClass().getName());
retVal.addElement(XMLUtilities.writeInt("oscillatorType", oscillatorType));
retVal.addElement(XMLUtilities.writeDouble("phaseInit", phaseInit));
retVal.addElement(XMLUtilities.writeDouble("frequency", getFrequency()));
retVal.addElement(XMLUtilities.writeBoolean("freqTableEnabled", isFreqTableEnabled()));
retVal.addElement(getFreqTable().saveAsXML());
retVal.addElement(XMLUtilities.writeDouble("exponent", exponent));
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class Quantizer method loadFromXML.
public static Quantizer loadFromXML(Element data) {
Quantizer retVal = new Quantizer();
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
String nodeVal = node.getTextString();
switch(nodeName) {
case "gridSize":
retVal.gridSize = Double.parseDouble(nodeVal);
break;
case "strength":
retVal.strength = Double.parseDouble(nodeVal);
break;
case "offset":
retVal.offset = Double.parseDouble(nodeVal);
break;
case "gridSizeTableEnabled":
retVal.gridSizeTableEnabled = Boolean.valueOf(node.getTextString()).booleanValue();
break;
case "strengthTableEnabled":
retVal.strengthTableEnabled = Boolean.valueOf(node.getTextString()).booleanValue();
break;
case "offsetTableEnabled":
retVal.offsetTableEnabled = Boolean.valueOf(node.getTextString()).booleanValue();
break;
case "enabled":
retVal.enabled = Boolean.valueOf(node.getTextString()).booleanValue();
break;
case "table":
Table t = Table.loadFromXML(node);
String tabInstance = node.getAttributeValue("tableId");
switch(tabInstance) {
case "gridSizeTable":
retVal.gridSizeTable = t;
break;
case "strengthTable":
retVal.strengthTable = t;
break;
case "offsetTable":
retVal.offsetTable = t;
break;
}
break;
}
}
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class Segment method saveAsXML.
@Override
public Element saveAsXML() {
Element retVal = new Element("generator");
retVal.setAttribute("type", getClass().getName());
retVal.addElement(table.saveAsXML());
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class Beta method saveAsXML.
@Override
public Element saveAsXML() {
Element retVal = new Element("probabilityGenerator");
retVal.setAttribute("type", getClass().getName());
retVal.addElement(XMLUtilities.writeDouble("a", a));
retVal.addElement(XMLUtilities.writeDouble("b", b));
retVal.addElement(XMLUtilities.writeBoolean("aTableEnabled", aTableEnabled));
retVal.addElement(XMLUtilities.writeBoolean("bTableEnabled", bTableEnabled));
Element aTableNode = aTable.saveAsXML();
aTableNode.setAttribute("tableId", "aTable");
Element bTableNode = bTable.saveAsXML();
bTableNode.setAttribute("tableId", "bTable");
retVal.addElement(aTableNode);
retVal.addElement(bTableNode);
return retVal;
}
Aggregations