use of blue.orchestra.blueSynthBuilder.BSBGraphicInterface in project blue by kunstmusik.
the class Effect method loadFromXML.
public static Effect loadFromXML(Element data) throws Exception {
Effect effect = new Effect(false);
Elements nodes = data.getElements();
while (nodes.hasMoreElements()) {
Element node = nodes.next();
String nodeName = node.getName();
switch(nodeName) {
case "name":
effect.setName(node.getTextString());
break;
case "enabled":
effect.setEnabled(XMLUtilities.readBoolean(node));
break;
case "numIns":
effect.setNumIns(XMLUtilities.readInt(node));
break;
case "numOuts":
effect.setNumOuts(XMLUtilities.readInt(node));
break;
case "code":
effect.setCode(node.getTextString());
break;
case "comments":
effect.setComments(node.getTextString());
break;
case "opcodeList":
effect.opcodeList = OpcodeList.loadFromXML(node);
break;
case "graphicInterface":
effect.setGraphicInterface(BSBGraphicInterface.loadFromXML(node));
break;
case "bsbParameterList":
case "parameterList":
effect.parameterList = (ParameterList) ParameterList.loadFromXML(node);
break;
}
}
if (effect.opcodeList == null) {
effect.opcodeList = new OpcodeList();
}
if (effect.graphicInterface == null) {
effect.graphicInterface = new BSBGraphicInterface();
}
if (effect.parameterList == null) {
effect.parameterList = new ParameterList();
}
effect.graphicInterface.getRootGroup().setParameterList(effect.parameterList);
return effect;
}
use of blue.orchestra.blueSynthBuilder.BSBGraphicInterface in project blue by kunstmusik.
the class SubChannelListPanel method reconcileNameChangeInBlueArrangement.
/**
* A hack to explicitly walk the current blue orchestra to find any
* BlueSynthBuilder's that contain BSBSubChannelDropdown's and to reconcile
* the name change.
*
* @param oldName
* @param newName
*/
private void reconcileNameChangeInBlueArrangement(String oldName, String newName) {
BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
if (data == null) {
return;
}
Arrangement arr = data.getArrangement();
for (int i = 0; i < arr.size(); i++) {
Instrument instr = arr.getInstrument(i);
if (instr instanceof BlueSynthBuilder) {
BlueSynthBuilder bsb = (BlueSynthBuilder) instr;
BSBGraphicInterface bsbInterface = bsb.getGraphicInterface();
for (BSBObject bsbObj : bsbInterface.getAllSet()) {
if (bsbObj instanceof BSBSubChannelDropdown) {
BSBSubChannelDropdown bsbSubDrop = (BSBSubChannelDropdown) bsbObj;
if (bsbSubDrop.getChannelOutput().equals(oldName)) {
bsbSubDrop.setChannelOutput(newName);
}
}
}
}
}
}
use of blue.orchestra.blueSynthBuilder.BSBGraphicInterface in project blue by kunstmusik.
the class BlueSynthBuilderEditor method editInstrument.
@Override
public void editInstrument(Instrument instr) {
if (instr == null) {
this.bsb = null;
return;
}
if (!(instr instanceof BlueSynthBuilder)) {
this.bsb = null;
return;
}
this.bsb = (BlueSynthBuilder) instr;
PresetGroup presetGroup = bsb.getPresetGroup();
BSBGraphicInterface graphicInterface = bsb.getGraphicInterface();
Platform.runLater(() -> interfaceEditor.editInterface(graphicInterface, presetGroup));
this.codeEditor.editBlueSynthBuilder(bsb);
this.udoPanel.editOpcodeList(bsb.getOpcodeList());
}
use of blue.orchestra.blueSynthBuilder.BSBGraphicInterface in project blue by kunstmusik.
the class ObjectBuilderEditor method editScoreObject.
@Override
public void editScoreObject(ScoreObject sObj) {
if (sObj == null || !(sObj instanceof ObjectBuilder)) {
this.objectBuilder = null;
System.err.println("[ERROR] ObjectBuilder::editSoundObject - " + "not instance of ObjectBuilder");
return;
}
if (this.objectBuilder != null) {
final ObjectBuilder temp = this.objectBuilder;
BlueFX.runOnFXThread(() -> temp.commentProperty().unbind());
}
this.objectBuilder = (ObjectBuilder) sObj;
PresetGroup presetGroup = objectBuilder.getPresetGroup();
BSBGraphicInterface graphicInterface = objectBuilder.getGraphicInterface();
this.interfaceEditor.editInterface(graphicInterface, presetGroup);
this.codeEditor.editObjectBuilder(objectBuilder);
BlueFX.runOnFXThread(() -> {
commentTextArea.setText(this.objectBuilder.getComment());
this.objectBuilder.commentProperty().bind(commentTextArea.textProperty());
});
}
use of blue.orchestra.blueSynthBuilder.BSBGraphicInterface in project blue by kunstmusik.
the class SubChannelListPanel method reconcileSubChannelRemoveInBlueArrangement.
/**
* A hack to explicitly walk the current blue orchestra to find any
* BlueSynthBuilder's that contain BSBSubChannelDropdown's and to reconcile
* with the removed channel
*
* @param removedChannel
*
* @param oldName
* @param newName
*/
private void reconcileSubChannelRemoveInBlueArrangement(String removedChannel) {
BlueData data = BlueProjectManager.getInstance().getCurrentBlueData();
if (data == null) {
return;
}
Arrangement arr = data.getArrangement();
for (int i = 0; i < arr.size(); i++) {
Instrument instr = arr.getInstrument(i);
if (instr instanceof BlueSynthBuilder) {
BlueSynthBuilder bsb = (BlueSynthBuilder) instr;
BSBGraphicInterface bsbInterface = bsb.getGraphicInterface();
for (BSBObject bsbObj : bsbInterface.getAllSet()) {
if (bsbObj instanceof BSBSubChannelDropdown) {
BSBSubChannelDropdown bsbSubDrop = (BSBSubChannelDropdown) bsbObj;
if (bsbSubDrop.getChannelOutput().equals(removedChannel)) {
bsbSubDrop.setChannelOutput(Channel.MASTER);
}
}
}
}
}
}
Aggregations