Search in sources :

Example 1 with BSBGraphicInterface

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;
}
Also used : BSBGraphicInterface(blue.orchestra.blueSynthBuilder.BSBGraphicInterface) OpcodeList(blue.udo.OpcodeList) Element(electric.xml.Element) ParameterList(blue.automation.ParameterList) Elements(electric.xml.Elements)

Example 2 with BSBGraphicInterface

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);
                    }
                }
            }
        }
    }
}
Also used : BlueData(blue.BlueData) BSBGraphicInterface(blue.orchestra.blueSynthBuilder.BSBGraphicInterface) BSBObject(blue.orchestra.blueSynthBuilder.BSBObject) BSBSubChannelDropdown(blue.orchestra.blueSynthBuilder.BSBSubChannelDropdown) Instrument(blue.orchestra.Instrument) BlueSynthBuilder(blue.orchestra.BlueSynthBuilder) Arrangement(blue.Arrangement)

Example 3 with BSBGraphicInterface

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());
}
Also used : BSBGraphicInterface(blue.orchestra.blueSynthBuilder.BSBGraphicInterface) PresetGroup(blue.orchestra.blueSynthBuilder.PresetGroup) BlueSynthBuilder(blue.orchestra.BlueSynthBuilder)

Example 4 with BSBGraphicInterface

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());
    });
}
Also used : BSBGraphicInterface(blue.orchestra.blueSynthBuilder.BSBGraphicInterface) PresetGroup(blue.orchestra.blueSynthBuilder.PresetGroup) ObjectBuilder(blue.soundObject.ObjectBuilder)

Example 5 with BSBGraphicInterface

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);
                    }
                }
            }
        }
    }
}
Also used : BlueData(blue.BlueData) BSBGraphicInterface(blue.orchestra.blueSynthBuilder.BSBGraphicInterface) BSBObject(blue.orchestra.blueSynthBuilder.BSBObject) BSBSubChannelDropdown(blue.orchestra.blueSynthBuilder.BSBSubChannelDropdown) Instrument(blue.orchestra.Instrument) BlueSynthBuilder(blue.orchestra.BlueSynthBuilder) Arrangement(blue.Arrangement)

Aggregations

BSBGraphicInterface (blue.orchestra.blueSynthBuilder.BSBGraphicInterface)5 BlueSynthBuilder (blue.orchestra.BlueSynthBuilder)3 Arrangement (blue.Arrangement)2 BlueData (blue.BlueData)2 Instrument (blue.orchestra.Instrument)2 BSBObject (blue.orchestra.blueSynthBuilder.BSBObject)2 BSBSubChannelDropdown (blue.orchestra.blueSynthBuilder.BSBSubChannelDropdown)2 PresetGroup (blue.orchestra.blueSynthBuilder.PresetGroup)2 ParameterList (blue.automation.ParameterList)1 ObjectBuilder (blue.soundObject.ObjectBuilder)1 OpcodeList (blue.udo.OpcodeList)1 Element (electric.xml.Element)1 Elements (electric.xml.Elements)1