Search in sources :

Example 1 with Element

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

the class NoteProcessorChain method loadFromXML.

public static NoteProcessorChain loadFromXML(Element data) throws Exception {
    NoteProcessorChain npc = new NoteProcessorChain();
    Elements nProcNodes = data.getElements("noteProcessor");
    while (nProcNodes.hasMoreElements()) {
        Element elem = nProcNodes.next();
        Object obj = ObjectUtilities.loadFromXML(elem);
        npc.add((NoteProcessor) obj);
    }
    return npc;
}
Also used : Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 2 with Element

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

the class RandomMultiplyProcessor 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("min").setText(this.getMin());
    retVal.addElement("max").setText(this.getMax());
    retVal.addElement("seedUsed").setText(this.getSeedUsed());
    retVal.addElement("seed").setText(this.getSeed());
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 3 with Element

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

the class TuningProcessor method loadFromXML.

public static NoteProcessor loadFromXML(Element data) {
    TuningProcessor tp = new TuningProcessor();
    Elements nodes = data.getElements();
    double baseFreq = -1;
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        switch(node.getName()) {
            case "baseFrequency":
                baseFreq = Double.parseDouble(node.getTextString());
                break;
            case "pfield":
                tp.setPfield(node.getTextString());
                break;
            case "scale":
                Scale scale;
                if (node.getElements().size() == 0) {
                    String scaleDir = BlueSystem.getUserConfigurationDirectory() + File.separator + "scl";
                    String scalePath = scaleDir + File.separator + node.getTextString();
                    File scaleFile = new File(scalePath);
                    scale = Scale.loadScale(scaleFile);
                } else {
                    scale = Scale.loadFromXML(node);
                }
                tp.setScale(scale);
                break;
        }
    }
    if (baseFreq > 0) {
        tp.getScale().setBaseFrequency(baseFreq);
    }
    // tp.setFileName(data.getElement("fileName").getTextString());
    return tp;
}
Also used : Element(electric.xml.Element) Scale(blue.soundObject.pianoRoll.Scale) Elements(electric.xml.Elements) File(java.io.File)

Example 4 with Element

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

the class BlueX7 method saveAsXML.

/*
     * (non-Javadoc)
     * 
     * @see blue.orchestra.Instrument#saveAsXML()
     */
@Override
public Element saveAsXML() {
    Element retVal = InstrumentUtilities.getBasicXML(this);
    retVal.addElement(algorithmCommon.saveAsXML());
    retVal.addElement(lfo.saveAsXML());
    for (int i = 0; i < operators.length; i++) {
        retVal.addElement(operators[i].saveAsXML());
    }
    for (int i = 0; i < peg.length; i++) {
        retVal.addElement(peg[i].saveAsXML());
    }
    retVal.addElement("csoundPostCode").setText(csoundPostCode);
    return retVal;
}
Also used : Element(electric.xml.Element) EnvelopePoint(blue.orchestra.blueX7.EnvelopePoint)

Example 5 with Element

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

the class EffectsChain method loadFromXML.

public static EffectsChain loadFromXML(Element data) throws Exception {
    EffectsChain chain = new EffectsChain();
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        switch(nodeName) {
            case "effect":
                chain.addEffect(Effect.loadFromXML(node));
                break;
            case "send":
                chain.addSend(Send.loadFromXML(node));
                break;
        }
    }
    return chain;
}
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