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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations