use of electric.xml.Elements 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;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class BlueShareRemoteCaller method getSoundObjectSubCategories.
private static BlueShareSoundObjectCategory[] getSoundObjectSubCategories(Element parent) {
Elements categories = parent.getElements();
BlueShareSoundObjectCategory[] iCategories = new BlueShareSoundObjectCategory[categories.size()];
int i = 0;
int catId;
String name;
Element temp;
BlueShareSoundObjectCategory[] tempCategories;
while (categories.hasMoreElements()) {
temp = categories.next();
catId = Integer.parseInt(temp.getAttribute("soundObjectCategoryId").getValue());
name = temp.getAttribute("name").getValue();
// description = temp.getElement("description").getTextString();
tempCategories = getSoundObjectSubCategories(temp);
iCategories[i] = new BlueShareSoundObjectCategory(catId, name, null, tempCategories);
i++;
}
return iCategories;
}
use of electric.xml.Elements 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;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class BlueShareRemoteCaller method getInstrumentOptionsForUser.
public static InstrumentOption[] getInstrumentOptionsForUser(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.getInstrumentListForUser", 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;
}
use of electric.xml.Elements in project blue by kunstmusik.
the class EffectCategory method loadFromXML.
public static EffectCategory loadFromXML(Element data) throws Exception {
EffectCategory instrCat = new EffectCategory();
instrCat.setCategoryName(data.getAttributeValue("categoryName"));
instrCat.setRoot(Boolean.valueOf(data.getAttributeValue("isRoot")).booleanValue());
Elements subCatNodes = data.getElements("effectCategory");
while (subCatNodes.hasMoreElements()) {
instrCat.addEffectCategory(EffectCategory.loadFromXML(subCatNodes.next()));
}
Elements effects = data.getElements("effect");
while (effects.hasMoreElements()) {
instrCat.addEffect(Effect.loadFromXML(effects.next()));
}
return instrCat;
}
Aggregations