Search in sources :

Example 21 with Document

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

the class BlueShareRemoteCaller method getEffectCategoryTree.

/* EFFECT METHODS */
public static BlueShareEffectCategory[] getEffectCategoryTree() throws IOException, XmlRpcException, ParseException {
    Vector v = new Vector();
    String result;
    Document doc;
    result = (String) xrpc.execute("blueShare.getEffectCategoryTree", v);
    doc = new Document(result);
    Element root = doc.getRoot();
    return getEffectSubCategories(root);
}
Also used : Element(electric.xml.Element) Document(electric.xml.Document) Vector(java.util.Vector)

Example 22 with Document

use of electric.xml.Document 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 23 with Document

use of electric.xml.Document 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 24 with Document

use of electric.xml.Document 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 25 with Document

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

the class BlueShareRemoteCaller method getLatestTenSoundObjects.

public static SoundObjectOption[] getLatestTenSoundObjects() throws XmlRpcException, IOException, ParseException {
    String result = (String) xrpc.execute("blueShare.getLatestTenSoundObjects", new Vector());
    Document 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)

Aggregations

Document (electric.xml.Document)35 Element (electric.xml.Element)22 ParseException (electric.xml.ParseException)17 Vector (java.util.Vector)17 IOException (java.io.IOException)13 Elements (electric.xml.Elements)12 File (java.io.File)12 XmlRpcException (org.apache.xmlrpc.XmlRpcException)6 SoundObject (blue.soundObject.SoundObject)4 EffectOption (blue.tools.blueShare.effects.EffectOption)3 InstrumentOption (blue.tools.blueShare.instruments.InstrumentOption)3 SoundObjectOption (blue.tools.blueShare.soundObjects.SoundObjectOption)3 MissingResourceException (java.util.MissingResourceException)3 BlueData (blue.BlueData)2 UDOLibrary (blue.udo.UDOLibrary)2 FileOutputStream (java.io.FileOutputStream)2 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)2 SoundLayer (blue.SoundLayer)1 Library (blue.library.Library)1 Effect (blue.mixer.Effect)1