use of electric.xml.Element in project blue by kunstmusik.
the class Instance method saveAsXML.
/*
* (non-Javadoc)
*
* @see blue.soundObject.SoundObject#saveAsXML()
*/
@Override
public Element saveAsXML(Map<Object, String> objRefMap) {
Element retVal = SoundObjectUtilities.getBasicXML(this);
retVal.addElement("soundObjectReference").setAttribute("soundObjectLibraryID", objRefMap.get(this.getSoundObject()));
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class ObjectBuilder method loadFromXML.
/*
* (non-Javadoc)
*
* @see blue.soundObject.SoundObject#loadFromXML(electric.xml.Element)
*/
public static SoundObject loadFromXML(Element data, Map<String, Object> objRefMap) throws Exception {
ObjectBuilder bsb = new ObjectBuilder();
SoundObjectUtilities.initBasicFromXML(data, bsb);
String editEnabledStr = data.getAttributeValue("editEnabled");
if (editEnabledStr != null) {
bsb.setEditEnabled(Boolean.valueOf(editEnabledStr).booleanValue());
}
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "code":
bsb.setCode(node.getTextString());
break;
case "commandLine":
bsb.setCommandLine(node.getTextString());
break;
case "isExternal":
// For Blue version < 2.7.2
if (XMLUtilities.readBoolean(node)) {
bsb.setLanguageType(LanguageType.EXTERNAL);
} else {
bsb.setLanguageType(LanguageType.PYTHON);
}
;
break;
case "graphicInterface":
bsb.setGraphicInterface(BSBGraphicInterface.loadFromXML(node));
break;
case "presetGroup":
bsb.setPresetGroup(PresetGroup.loadFromXML(node));
break;
case "comment":
bsb.setComment(node.getTextString());
break;
case "languageType":
bsb.setLanguageType(LanguageType.valueOf(node.getTextString()));
break;
}
}
return bsb;
}
use of electric.xml.Element in project blue by kunstmusik.
the class FrozenSoundObject method saveAsXML.
/*
* (non-Javadoc)
*
* @see blue.soundObject.SoundObject#saveAsXML()
*/
@Override
public Element saveAsXML(Map<Object, String> objRefMap) {
Element retVal = SoundObjectUtilities.getBasicXML(this);
retVal.addElement("numChannels").setText(Integer.toString(this.getNumChannels()));
retVal.addElement("frozenWaveFileName").setText(this.getFrozenWaveFileName());
retVal.addElement(this.getFrozenSoundObject().saveAsXML(objRefMap));
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class Accumulator method saveAsXML.
public Element saveAsXML() {
Element retVal = new Element("accumulator");
Element hTableNode = highTable.saveAsXML();
hTableNode.setAttribute("tableId", "highTable");
retVal.addElement(hTableNode);
Element lTableNode = lowTable.saveAsXML();
lTableNode.setAttribute("tableId", "lowTable");
retVal.addElement(lTableNode);
retVal.addElement(XMLUtilities.writeBoolean("highTableEnabled", highTableEnabled));
retVal.addElement(XMLUtilities.writeBoolean("lowTableEnabled", lowTableEnabled));
retVal.addElement(XMLUtilities.writeInt("mode", mode));
retVal.addElement(XMLUtilities.writeDouble("low", low));
retVal.addElement(XMLUtilities.writeDouble("high", high));
retVal.addElement(XMLUtilities.writeDouble("initialValue", initialValue));
retVal.addElement(XMLUtilities.writeBoolean("enabled", enabled));
return retVal;
}
use of electric.xml.Element in project blue by kunstmusik.
the class PianoRoll method saveAsXML.
@Override
public Element saveAsXML(Map<Object, String> objRefMap) {
Element retVal = SoundObjectUtilities.getBasicXML(this);
retVal.addElement("noteTemplate").setText(getNoteTemplate());
retVal.addElement("instrumentId").setText(getInstrumentId());
retVal.addElement(scale.saveAsXML());
retVal.addElement("pixelSecond").setText(Integer.toString(this.getPixelSecond()));
retVal.addElement("noteHeight").setText(Integer.toString(this.getNoteHeight()));
retVal.addElement("snapEnabled").setText(Boolean.toString(this.isSnapEnabled()));
retVal.addElement("snapValue").setText(Double.toString(this.getSnapValue()));
retVal.addElement("timeDisplay").setText(Integer.toString(this.getTimeDisplay()));
retVal.addElement("timeUnit").setText(Integer.toString(this.getTimeUnit()));
retVal.addElement("pchGenerationMethod").setText(Integer.toString(this.getPchGenerationMethod()));
retVal.addElement("transposition").setText(Integer.toString(this.getTransposition()));
for (Iterator<PianoNote> iter = notes.iterator(); iter.hasNext(); ) {
PianoNote note = iter.next();
retVal.addElement(note.saveAsXML());
}
return retVal;
}
Aggregations