Search in sources :

Example 6 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class Send method loadFromXML.

public static Send loadFromXML(Element data) {
    Send send = new Send(false);
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        switch(nodeName) {
            case "sendChannel":
                send.sendChannel = node.getTextString();
                break;
            case "level":
                send.level = Double.parseDouble(node.getTextString());
                break;
            case "enabled":
                send.enabled = Boolean.valueOf(node.getTextString()).booleanValue();
                break;
            case "parameter":
                send.levelParameter = Parameter.loadFromXML(node);
                send.levelParameter.addParameterListener(send);
                send.params.add(send.levelParameter);
                break;
        }
    }
    if (send.params.size() == 0) {
        send.levelParameter = new Parameter();
        send.levelParameter.setName("Send Amount");
        send.levelParameter.setMin(0.0f, false);
        send.levelParameter.setMax(1.0f, false);
        send.levelParameter.setValue(1.0f);
        send.levelParameter.setResolution(new BigDecimal(-1.0f));
        send.levelParameter.addParameterListener(send);
        send.params.add(send.levelParameter);
    }
    return send;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements) BigDecimal(java.math.BigDecimal)

Example 7 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class InversionProcessor method saveAsXML.

/*
     * (non-Javadoc)
     * 
     * @see blue.noteProcessor.NoteProcessor#saveAsXML()
     */
@Override
public Element saveAsXML() {
    Element retVal = new Element("noteProcessor");
    retVal.setAttribute("type", this.getClass().getName());
    retVal.addElement("pfield").setText(this.getPfield());
    retVal.addElement("value").setText(this.getVal());
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 8 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class LineMultiplyProcessor method saveAsXML.

/*
     * (non-Javadoc)
     * 
     * @see blue.noteProcessor.NoteProcessor#saveAsXML()
     */
@Override
public Element saveAsXML() {
    Element retVal = new Element("noteProcessor");
    retVal.setAttribute("type", this.getClass().getName());
    retVal.addElement("pfield").setText(this.getPfield());
    retVal.addElement("lineMultiplyString").setText(this.getLineMultiplyString());
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 9 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class InstrumentUtilities method getBasicXML.

public static Element getBasicXML(Instrument instr) {
    Element retVal = new Element("instrument");
    retVal.setAttribute("type", instr.getClass().getName());
    retVal.addElement("name").setText(instr.getName());
    retVal.addElement("comment").setText(instr.getComment());
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 10 with Element

use of electric.xml.Element in project blue by kunstmusik.

the class PythonInstrument method loadFromXML.

public static Instrument loadFromXML(Element data) throws Exception {
    PythonInstrument instr = new PythonInstrument();
    InstrumentUtilities.initBasicFromXML(data, instr);
    Elements elements = data.getElements();
    while (elements.hasMoreElements()) {
        Element node = elements.next();
        String nodeName = node.getName();
        switch(nodeName) {
            case "globalOrc":
                instr.setGlobalOrc(node.getTextString());
                break;
            case "globalSco":
                instr.setGlobalSco(node.getTextString());
                break;
            case "instrumentText":
                instr.setText(node.getTextString());
                break;
            case "opcodeList":
                instr.opcodeList = OpcodeList.loadFromXML(node);
                break;
        }
    }
    return instr;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Aggregations

Element (electric.xml.Element)310 Elements (electric.xml.Elements)120 Document (electric.xml.Document)22 Vector (java.util.Vector)14 Iterator (java.util.Iterator)12 File (java.io.File)10 BigDecimal (java.math.BigDecimal)10 IOException (java.io.IOException)8 SoundObject (blue.soundObject.SoundObject)7 ParseException (electric.xml.ParseException)7 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)4 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 Test (org.junit.Test)3 ParameterList (blue.automation.ParameterList)2 LiveObject (blue.blueLive.LiveObject)2 LiveObjectBins (blue.blueLive.LiveObjectBins)2 Line (blue.components.lines.Line)2