use of electric.xml.Elements in project blue by kunstmusik.
the class External method loadFromXML.
/*
* (non-Javadoc)
*
* @see blue.soundObject.SoundObject#loadFromXML(electric.xml.Element)
*/
public static SoundObject loadFromXML(Element data, Map<String, Object> objRefMap) throws Exception {
External external = new External();
SoundObjectUtilities.initBasicFromXML(data, external);
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "text":
external.setText(node.getTextString());
break;
case "commandLine":
external.setCommandLine(node.getTextString());
break;
case "syntaxType":
external.setSyntaxType(node.getTextString());
break;
}
}
return external;
}
use of electric.xml.Elements 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.Elements in project blue by kunstmusik.
the class Sound method loadFromXML.
/*
* (non-Javadoc)
*
* @see blue.soundObject.SoundObject#loadFromXML(electric.xml.Element)
*/
public static SoundObject loadFromXML(Element data, Map<String, Object> objRefMap) throws Exception {
Sound sObj = new Sound();
SoundObjectUtilities.initBasicFromXML(data, sObj);
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
// For backwards compatibility with Blue versions < 2.6.0
case "instrumentText":
sObj.bsbObj.setInstrumentText(node.getTextString());
break;
case "instrument":
sObj.setBlueSynthBuilder((BlueSynthBuilder) BlueSynthBuilder.loadFromXML(node));
break;
case "comment":
sObj.setComment(node.getTextString());
break;
}
}
return sObj;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class ScriptCategory method loadFromXML.
public static ScriptCategory loadFromXML(Element data) throws Exception {
ScriptCategory scriptCat = new ScriptCategory();
scriptCat.setCategoryName(data.getAttributeValue("categoryName"));
scriptCat.setRoot(Boolean.valueOf(data.getAttributeValue("isRoot")).booleanValue());
Elements subCatNodes = data.getElements("scriptCategory");
while (subCatNodes.hasMoreElements()) {
scriptCat.addScriptCategory(ScriptCategory.loadFromXML(subCatNodes.next()));
}
Elements scripts = data.getElements("script");
while (scripts.hasMoreElements()) {
scriptCat.addScript(Script.loadFromXML(scripts.next()));
}
return scriptCat;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class PresetGroup method loadFromXML.
public static PresetGroup loadFromXML(Element data) {
PresetGroup group = new PresetGroup();
group.setPresetGroupName(data.getAttributeValue("name"));
String val = data.getAttributeValue("currentPresetUniqueId");
if (val != null && val.length() > 0) {
group.setCurrentPresetUniqueId(val);
}
val = data.getAttributeValue("currentPresetModified");
if (val != null && val.length() > 0) {
group.setCurrentPresetModified(Boolean.valueOf(val).booleanValue());
}
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
switch(node.getName()) {
case "presetGroup":
PresetGroup pGroup = PresetGroup.loadFromXML(node);
group.getSubGroups().add(pGroup);
break;
case "preset":
Preset preset = Preset.loadFromXML(node);
group.getPresets().add(preset);
break;
}
}
return group;
}
Aggregations