use of electric.xml.Elements in project blue by kunstmusik.
the class PatternLayer method loadFromXML.
public static PatternLayer loadFromXML(Element data) {
PatternLayer layer = new PatternLayer();
layer.setName(data.getAttributeValue("name"));
layer.setMuted(Boolean.valueOf(data.getAttributeValue("muted")).booleanValue());
layer.setSolo(Boolean.valueOf(data.getAttributeValue("solo")).booleanValue());
Elements nodes = data.getElements();
int heightIndex = -1;
boolean oldTimeStateValuesFound = false;
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
if ("soundObject".equals(nodeName)) {
try {
layer.setSoundObject((SoundObject) ObjectUtilities.loadFromXML(node, null));
} catch (Exception ex) {
Logger.getLogger(PatternLayer.class.getName()).log(Level.SEVERE, null, ex);
}
} else if (nodeName.equals("patternData")) {
layer.patternData = PatternData.loadFromXML(node);
}
}
return layer;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class WindowSettingManager method setBasicSettings.
public static void setBasicSettings(Element data, Window window) {
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "x":
int x = Integer.parseInt(node.getTextString());
window.setLocation(x, window.getY());
break;
case "y":
int y = Integer.parseInt(node.getTextString());
window.setLocation(window.getX(), y);
break;
case "width":
int w = Integer.parseInt(node.getTextString());
window.setSize(w, window.getHeight());
break;
case "height":
int h = Integer.parseInt(node.getTextString());
window.setSize(window.getWidth(), h);
break;
}
}
}
use of electric.xml.Elements in project blue by kunstmusik.
the class AudioLayerGroup method loadFromXML.
public static AudioLayerGroup loadFromXML(Element data) throws Exception {
AudioLayerGroup layerGroup = new AudioLayerGroup();
if (data.getAttribute("name") != null) {
layerGroup.setName(data.getAttributeValue("name"));
}
if (data.getAttribute("uniqueId") != null) {
layerGroup.uniqueId = data.getAttributeValue("uniqueId");
}
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "audioLayers":
Elements aLayerNodes = node.getElements();
while (aLayerNodes.hasMoreElements()) {
layerGroup.add(AudioLayer.loadFromXML(aLayerNodes.next()));
}
break;
case "defaultHeightIndex":
{
int index = Integer.parseInt(node.getTextString());
layerGroup.setDefaultHeightIndex(index);
break;
}
}
}
return layerGroup;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class PatternsLayerGroup method loadFromXML.
public static PatternsLayerGroup loadFromXML(Element data) throws Exception {
PatternsLayerGroup layerGroup = new PatternsLayerGroup();
if (data.getAttribute("name") != null) {
layerGroup.setName(data.getAttributeValue("name"));
}
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
if ("patternLayers".equals(nodeName)) {
Elements patternNodes = node.getElements();
while (patternNodes.hasMoreElements()) {
Element patternNode = patternNodes.next();
if ("patternLayer".equals(patternNode.getName())) {
layerGroup.add(PatternLayer.loadFromXML(patternNode));
}
}
} else if ("noteProcessorChain".equals(nodeName)) {
layerGroup.setNoteProcessorChain(NoteProcessorChain.loadFromXML(node));
}
}
return layerGroup;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class Mixer method loadFromXML.
public static Mixer loadFromXML(Element data) throws Exception {
Mixer mixer = new Mixer();
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "enabled":
mixer.setEnabled(XMLUtilities.readBoolean(node));
break;
case "extraRenderTime":
mixer.setExtraRenderTime(XMLUtilities.readDouble(node));
break;
case "channelList":
String listType = node.getAttributeValue("list");
switch(listType) {
case "channels":
mixer.setChannels(ChannelList.loadFromXML(node));
mixer.getChannels().setListName("Orchestra");
mixer.getChannels().setListNameEditSupported(false);
break;
case "subChannels":
mixer.setSubChannels(ChannelList.loadFromXML(node));
mixer.getSubChannels().setListName("SubChannels");
mixer.getSubChannels().setListNameEditSupported(false);
break;
}
break;
case "channelListGroups":
Elements listGroupsNodes = node.getElements();
while (listGroupsNodes.hasMoreElements()) {
mixer.channelListGroups.add(ChannelList.loadFromXML(listGroupsNodes.next()));
}
break;
case "channel":
mixer.setMaster(Channel.loadFromXML(node));
break;
}
}
return mixer;
}
Aggregations