Search in sources :

Example 91 with Element

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

Example 92 with Element

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

the class Constant method saveAsXML.

@Override
public Element saveAsXML() {
    Element retVal = new Element("generator");
    retVal.setAttribute("type", getClass().getName());
    retVal.addElement("value").setText(Double.toString(value));
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 93 with Element

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

the class ScriptCategory method saveAsXML.

public Element saveAsXML() {
    Element retVal = new Element("scriptCategory");
    retVal.setAttribute("categoryName", this.getCategoryName());
    retVal.setAttribute("isRoot", Boolean.toString(this.isRoot()));
    for (Iterator iter = subCategories.iterator(); iter.hasNext(); ) {
        ScriptCategory tempCat = (ScriptCategory) iter.next();
        retVal.addElement(tempCat.saveAsXML());
    }
    for (Iterator iter = scripts.iterator(); iter.hasNext(); ) {
        Script effect = (Script) iter.next();
        retVal.addElement(effect.saveAsXML());
    }
    return retVal;
}
Also used : Element(electric.xml.Element) Iterator(java.util.Iterator)

Example 94 with Element

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

the class Script method saveAsXML.

public Element saveAsXML() {
    Element retVal = new Element("script");
    retVal.addElement("name").setText(name);
    retVal.addElement("description").setText(description);
    retVal.addElement("code").setText(code);
    retVal.addElement("comments").setText(comments);
    return retVal;
}
Also used : Element(electric.xml.Element)

Example 95 with Element

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

the class ScriptLibrary method saveAsXML.

public Element saveAsXML() {
    Element retVal = new Element("scriptLibrary");
    retVal.addElement(rootScriptCategory.saveAsXML());
    return retVal;
}
Also used : Element(electric.xml.Element)

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