Search in sources :

Example 71 with Elements

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

the class WindowSettingManager method load.

private void load() {
    String userDir = BlueSystem.getUserConfigurationDirectory();
    String settingsFile = userDir + File.separator + SETTINGS_FILE_NAME;
    File f = new File(settingsFile);
    if (!f.exists()) {
        return;
    }
    try {
        Document doc = new Document(f);
        Element root = doc.getRoot();
        Elements nodes = root.getElements();
        while (nodes.hasMoreElements()) {
            Element node = nodes.next();
            String key = node.getAttributeValue("windowName");
            settings.put(key, node);
        }
    } catch (ParseException e) {
        e.printStackTrace();
    }
}
Also used : Element(electric.xml.Element) ParseException(electric.xml.ParseException) Document(electric.xml.Document) Elements(electric.xml.Elements) File(java.io.File)

Example 72 with Elements

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

the class UDORepositoryBrowser method getCategory.

private DefaultMutableTreeNode getCategory(Element node) {
    UDOItem catObj = new UDOItem();
    if (node.getName().equals("udoCategories")) {
        catObj.itemName = "UDO Categories";
        catObj.itemId = -1;
    } else {
        catObj.itemName = node.getAttributeValue("name");
        catObj.itemId = Integer.parseInt(node.getAttributeValue("categoryId"));
    }
    DefaultMutableTreeNode retVal = new DefaultMutableTreeNode(catObj);
    Elements nodes = node.getElements();
    while (nodes.hasMoreElements()) {
        Element tempNode = nodes.next();
        retVal.add(getCategory(tempNode));
    }
    return retVal;
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 73 with Elements

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

the class BlueShareRemoteCaller method getSoundObjectOptions.

public static SoundObjectOption[] getSoundObjectOptions(BlueShareSoundObjectCategory iCategory) throws IOException, XmlRpcException, ParseException {
    Vector v = new Vector();
    String result;
    Document doc;
    v.add(new Integer(iCategory.getCategoryId()));
    result = (String) xrpc.execute("blueShare.getSoundObjectList", v);
    doc = new Document(result);
    Element root = doc.getRoot();
    Elements soundObjects = root.getElements("soundObject");
    SoundObjectOption[] iOptions = new SoundObjectOption[soundObjects.size()];
    int i = 0;
    int soundObjectId;
    String screenName, name, type, description, category;
    Element temp;
    while (soundObjects.hasMoreElements()) {
        temp = soundObjects.next();
        soundObjectId = Integer.parseInt(temp.getAttribute("soundObjectId").getValue());
        screenName = temp.getElement("screenName").getTextString();
        name = temp.getElement("name").getTextString();
        type = temp.getElement("type").getTextString();
        description = temp.getElement("description").getTextString();
        category = temp.getElement("category").getTextString();
        iOptions[i] = new SoundObjectOption(soundObjectId, checkNullString(screenName), checkNullString(name), checkNullString(type), checkNullString(description), checkNullString(category));
        i++;
    }
    return iOptions;
}
Also used : SoundObjectOption(blue.tools.blueShare.soundObjects.SoundObjectOption) Element(electric.xml.Element) Document(electric.xml.Document) Elements(electric.xml.Elements) Vector(java.util.Vector)

Example 74 with Elements

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

the class BlueShareRemoteCaller method getSoundObjectOptionsForUser.

public static SoundObjectOption[] getSoundObjectOptionsForUser(String username, String password) throws IOException, XmlRpcException, ParseException {
    Vector v = new Vector();
    String result;
    Document doc;
    v.add(username);
    v.add(password);
    result = (String) xrpc.execute("blueShare.getSoundObjectListForUser", v);
    doc = new Document(result);
    Element root = doc.getRoot();
    Elements soundObjects = root.getElements("soundObject");
    SoundObjectOption[] iOptions = new SoundObjectOption[soundObjects.size()];
    int i = 0;
    int soundObjectId;
    String screenName, name, type, description, category;
    Element temp;
    while (soundObjects.hasMoreElements()) {
        temp = soundObjects.next();
        soundObjectId = Integer.parseInt(temp.getAttribute("soundObjectId").getValue());
        screenName = temp.getElement("screenName").getTextString();
        name = temp.getElement("name").getTextString();
        type = temp.getElement("type").getTextString();
        description = temp.getElement("description").getTextString();
        category = temp.getElement("category").getTextString();
        iOptions[i] = new SoundObjectOption(soundObjectId, checkNullString(screenName), checkNullString(name), checkNullString(type), checkNullString(description), checkNullString(category));
        i++;
    }
    return iOptions;
}
Also used : SoundObjectOption(blue.tools.blueShare.soundObjects.SoundObjectOption) Element(electric.xml.Element) Document(electric.xml.Document) Elements(electric.xml.Elements) Vector(java.util.Vector)

Example 75 with Elements

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

the class BlueShareRemoteCaller method getEffectOptions.

public static EffectOption[] getEffectOptions(BlueShareEffectCategory iCategory) throws IOException, XmlRpcException, ParseException {
    Vector v = new Vector();
    String result;
    Document doc;
    v.add(new Integer(iCategory.getCategoryId()));
    result = (String) xrpc.execute("blueShare.getEffectList", v);
    doc = new Document(result);
    Element root = doc.getRoot();
    Elements instruments = root.getElements("effect");
    EffectOption[] effectOptions = new EffectOption[instruments.size()];
    int i = 0;
    int instrumentId;
    String screenName, name, description, category;
    Element temp;
    while (instruments.hasMoreElements()) {
        temp = instruments.next();
        instrumentId = Integer.parseInt(temp.getAttribute("effectId").getValue());
        screenName = temp.getElement("screenName").getTextString();
        name = temp.getElement("name").getTextString();
        description = temp.getElement("description").getTextString();
        category = temp.getElement("category").getTextString();
        effectOptions[i] = new EffectOption(instrumentId, checkNullString(screenName), checkNullString(name), checkNullString(description), checkNullString(category));
        i++;
    }
    return effectOptions;
}
Also used : Element(electric.xml.Element) Document(electric.xml.Document) Elements(electric.xml.Elements) EffectOption(blue.tools.blueShare.effects.EffectOption) Vector(java.util.Vector)

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