Search in sources :

Example 96 with Elements

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;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements) SoundObjectException(blue.soundObject.SoundObjectException)

Example 97 with Elements

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;
        }
    }
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 98 with Elements

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;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 99 with Elements

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;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 100 with Elements

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;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Aggregations

Elements (electric.xml.Elements)131 Element (electric.xml.Element)120 Document (electric.xml.Document)12 BigDecimal (java.math.BigDecimal)10 Vector (java.util.Vector)10 File (java.io.File)4 SoundObject (blue.soundObject.SoundObject)3 EffectOption (blue.tools.blueShare.effects.EffectOption)3 InstrumentOption (blue.tools.blueShare.instruments.InstrumentOption)3 SoundObjectOption (blue.tools.blueShare.soundObjects.SoundObjectOption)3 OpcodeList (blue.udo.OpcodeList)3 ParseException (electric.xml.ParseException)3 ArrayList (java.util.ArrayList)3 ParameterList (blue.automation.ParameterList)2 Line (blue.components.lines.Line)2 Color (java.awt.Color)2 IOException (java.io.IOException)2 Font (javafx.scene.text.Font)2 LiveObject (blue.blueLive.LiveObject)1 LiveObjectBins (blue.blueLive.LiveObjectBins)1