Search in sources :

Example 1 with EffectOption

use of blue.tools.blueShare.effects.EffectOption 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 2 with EffectOption

use of blue.tools.blueShare.effects.EffectOption 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)

Example 3 with EffectOption

use of blue.tools.blueShare.effects.EffectOption in project blue by kunstmusik.

the class BlueShareRemoteCaller method getLatestTenEffects.

public static EffectOption[] getLatestTenEffects() throws XmlRpcException, IOException, ParseException {
    String result = (String) xrpc.execute("blueShare.getLatestTenEffects", new Vector());
    Document doc = new Document(result);
    Element root = doc.getRoot();
    Elements instruments = root.getElements("effect");
    EffectOption[] effectOptions = 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();
        effectOptions[i] = new EffectOption(effectId, 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

EffectOption (blue.tools.blueShare.effects.EffectOption)3 Document (electric.xml.Document)3 Element (electric.xml.Element)3 Elements (electric.xml.Elements)3 Vector (java.util.Vector)3