use of electric.xml.Document 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.Document in project blue by kunstmusik.
the class BlueShareRemoteCaller method getEffect.
public static Effect getEffect(EffectOption iOption) throws IOException, XmlRpcException, ParseException {
Vector v = new Vector();
String result;
v.add(new Integer(iOption.getInstrumentId()));
result = (String) xrpc.execute("blueShare.getEffect", v);
Effect effect = null;
try {
Document d = new Document(result);
effect = Effect.loadFromXML(d.getRoot());
} catch (Exception e) {
}
return effect;
}
use of electric.xml.Document in project blue by kunstmusik.
the class BlueShareRemoteCaller method getSoundObjectCategoryTree.
/* SOUNDOBJECT METHODS */
public static BlueShareSoundObjectCategory[] getSoundObjectCategoryTree() throws IOException, XmlRpcException, ParseException {
Vector v = new Vector();
String result;
Document doc;
result = (String) xrpc.execute("blueShare.getSoundObjectCategoryTree", v);
doc = new Document(result);
Element root = doc.getRoot();
return getSoundObjectSubCategories(root);
}
use of electric.xml.Document in project blue by kunstmusik.
the class BlueShareRemoteCaller method getSoundObject.
public static SoundObject getSoundObject(SoundObjectOption iOption) throws IOException, XmlRpcException, ParseException {
Vector v = new Vector();
String result;
v.add(new Integer(iOption.getSoundObjectId()));
result = (String) xrpc.execute("blueShare.getSoundObject", v);
SoundObject soundObject = null;
try {
Document d = new Document(result);
soundObject = (SoundObject) ObjectUtilities.loadFromXML(d.getRoot(), new HashMap<>());
} catch (Exception e) {
}
return soundObject;
}
use of electric.xml.Document in project blue by kunstmusik.
the class CodeRepositoryManager method saveCodeRepository.
public static void saveCodeRepository(DefaultMutableTreeNode node) {
Element root = getElement(node);
Document doc = new Document();
doc.addChild(new XMLDecl("1.0", "UTF-8"));
doc.setRoot(root);
try {
try (FileOutputStream out = new FileOutputStream(BlueSystem.getCodeRepository())) {
doc.write(out);
out.flush();
}
} catch (Exception e) {
e.printStackTrace();
}
CodeRepositoryMenu.reinitialize();
}
Aggregations