Search in sources :

Example 66 with Elements

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

the class BlueShareRemoteCaller method getLatestTenInstruments.

public static InstrumentOption[] getLatestTenInstruments() throws XmlRpcException, IOException, ParseException {
    String result = (String) xrpc.execute("blueShare.getLatestTen", new Vector());
    Document doc = new Document(result);
    Element root = doc.getRoot();
    Elements instruments = root.getElements("instrument");
    InstrumentOption[] iOptions = new InstrumentOption[instruments.size()];
    int i = 0;
    int instrumentId;
    String screenName, name, type, description, category;
    Element temp;
    while (instruments.hasMoreElements()) {
        temp = instruments.next();
        instrumentId = Integer.parseInt(temp.getAttribute("instrumentId").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 InstrumentOption(instrumentId, checkNullString(screenName), checkNullString(name), checkNullString(type), checkNullString(description), checkNullString(category));
        i++;
    }
    return iOptions;
}
Also used : InstrumentOption(blue.tools.blueShare.instruments.InstrumentOption) Element(electric.xml.Element) Document(electric.xml.Document) Elements(electric.xml.Elements) Vector(java.util.Vector)

Example 67 with Elements

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

the class BlueShareRemoteCaller method getEffectOptionsForUser.

public static EffectOption[] getEffectOptionsForUser(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.getEffectListForUser", v);
    doc = new Document(result);
    Element root = doc.getRoot();
    Elements instruments = root.getElements("effect");
    EffectOption[] iOptions = new EffectOption[instruments.size()];
    int i = 0;
    int effectId;
    String screenName, name, description, category;
    Element temp;
    while (instruments.hasMoreElements()) {
        temp = instruments.next();
        effectId = 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();
        iOptions[i] = new EffectOption(effectId, checkNullString(screenName), checkNullString(name), checkNullString(description), checkNullString(category));
        i++;
    }
    return iOptions;
}
Also used : Element(electric.xml.Element) Document(electric.xml.Document) Elements(electric.xml.Elements) EffectOption(blue.tools.blueShare.effects.EffectOption) Vector(java.util.Vector)

Example 68 with Elements

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

the class BlueShareRemoteCaller method getSubCategories.

private static BlueShareInstrumentCategory[] getSubCategories(Element parent) {
    Elements categories = parent.getElements();
    BlueShareInstrumentCategory[] iCategories = new BlueShareInstrumentCategory[categories.size()];
    int i = 0;
    int catId;
    String name;
    Element temp;
    BlueShareInstrumentCategory[] tempCategories;
    while (categories.hasMoreElements()) {
        temp = categories.next();
        catId = Integer.parseInt(temp.getAttribute("instrumentCategoryId").getValue());
        name = temp.getAttribute("name").getValue();
        // description = temp.getElement("description").getTextString();
        tempCategories = getSubCategories(temp);
        iCategories[i] = new BlueShareInstrumentCategory(catId, name, null, tempCategories);
        i++;
    }
    return iCategories;
}
Also used : BlueShareInstrumentCategory(blue.tools.blueShare.instruments.BlueShareInstrumentCategory) Element(electric.xml.Element) Elements(electric.xml.Elements)

Example 69 with Elements

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

the class BlueShareRemoteCaller method getInstrumentOptions.

public static InstrumentOption[] getInstrumentOptions(BlueShareInstrumentCategory iCategory) throws IOException, XmlRpcException, ParseException {
    Vector v = new Vector();
    String result;
    Document doc;
    v.add(new Integer(iCategory.getCategoryId()));
    result = (String) xrpc.execute("blueShare.getInstrumentList", v);
    doc = new Document(result);
    Element root = doc.getRoot();
    Elements instruments = root.getElements("instrument");
    InstrumentOption[] iOptions = new InstrumentOption[instruments.size()];
    int i = 0;
    int instrumentId;
    String screenName, name, type, description, category;
    Element temp;
    while (instruments.hasMoreElements()) {
        temp = instruments.next();
        instrumentId = Integer.parseInt(temp.getAttribute("instrumentId").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 InstrumentOption(instrumentId, checkNullString(screenName), checkNullString(name), checkNullString(type), checkNullString(description), checkNullString(category));
        i++;
    }
    return iOptions;
}
Also used : InstrumentOption(blue.tools.blueShare.instruments.InstrumentOption) Element(electric.xml.Element) Document(electric.xml.Document) Elements(electric.xml.Elements) Vector(java.util.Vector)

Example 70 with Elements

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

the class BlueShareRemoteCaller method getEffectSubCategories.

private static BlueShareEffectCategory[] getEffectSubCategories(Element parent) {
    Elements categories = parent.getElements();
    BlueShareEffectCategory[] iCategories = new BlueShareEffectCategory[categories.size()];
    int i = 0;
    int catId;
    String name;
    Element temp;
    BlueShareEffectCategory[] tempCategories;
    while (categories.hasMoreElements()) {
        temp = categories.next();
        catId = Integer.parseInt(temp.getAttribute("effectCategoryId").getValue());
        name = temp.getAttribute("name").getValue();
        // description = temp.getElement("description").getTextString();
        tempCategories = getEffectSubCategories(temp);
        iCategories[i] = new BlueShareEffectCategory(catId, name, null, tempCategories);
        i++;
    }
    return iCategories;
}
Also used : Element(electric.xml.Element) BlueShareEffectCategory(blue.tools.blueShare.effects.BlueShareEffectCategory) 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