Search in sources :

Example 6 with ParameterList

use of blue.automation.ParameterList in project blue by kunstmusik.

the class CompileData method addInstrument.

/**
 * Adds and instrument to the Arrangement
 * @return instrument id that was assigned
 */
public int addInstrument(Instrument instrument) {
    if (handleParametersAndChannels && stringChannels != null && originalParameters != null) {
        if (instrument instanceof Automatable) {
            Automatable auto = (Automatable) instrument;
            ArrayList<StringChannel> tempStringChannels = auto.getStringChannels();
            if (tempStringChannels != null) {
                stringChannels.addAll(tempStringChannels);
                for (StringChannel sChan : tempStringChannels) {
                    sChan.setChannelName(scnm.getUniqueStringChannel());
                }
            }
            ParameterList paramList = auto.getParameterList();
            if (paramList != null) {
                originalParameters.addAll(paramList);
                for (Parameter param : paramList) {
                    param.setCompilationVarName(pnm.getUniqueParamName());
                }
            }
        }
    }
    return arrangement.addInstrument(instrument);
}
Also used : StringChannel(blue.orchestra.blueSynthBuilder.StringChannel) ParameterList(blue.automation.ParameterList) Parameter(blue.automation.Parameter) Automatable(blue.automation.Automatable)

Example 7 with ParameterList

use of blue.automation.ParameterList in project blue by kunstmusik.

the class BlueSynthBuilder method loadFromXML.

// private void doPostCompilation() {
// bsbCompilationUnit = null;
// }
/* XML SERIALIZATION */
public static Instrument loadFromXML(Element data) throws Exception {
    BlueSynthBuilder bsb = new BlueSynthBuilder(false);
    InstrumentUtilities.initBasicFromXML(data, bsb);
    String editEnabledStr = data.getAttributeValue("editEnabled");
    if (editEnabledStr != null) {
        bsb.setEditEnabled(Boolean.valueOf(editEnabledStr).booleanValue());
    }
    Elements nodes = data.getElements();
    while (nodes.hasMoreElements()) {
        Element node = nodes.next();
        String nodeName = node.getName();
        switch(nodeName) {
            case "globalOrc":
                bsb.setGlobalOrc(node.getTextString());
                break;
            case "globalSco":
                bsb.setGlobalSco(node.getTextString());
                break;
            case "instrumentText":
                bsb.setInstrumentText(node.getTextString());
                break;
            case "alwaysOnInstrumentText":
                bsb.setAlwaysOnInstrumentText(node.getTextString());
                break;
            case "graphicInterface":
                bsb.setGraphicInterface(BSBGraphicInterface.loadFromXML(node));
                break;
            case "presetGroup":
                bsb.setPresetGroup(PresetGroup.loadFromXML(node));
                break;
            case "bsbParameterList":
            case "parameterList":
                bsb.parameterList = ParameterList.loadFromXML(node);
                break;
            case "opcodeList":
                bsb.opcodeList = OpcodeList.loadFromXML(node);
                break;
        }
    }
    if (bsb.presetGroup == null) {
        bsb.presetGroup = new PresetGroup();
    }
    if (bsb.graphicInterface == null) {
        bsb.graphicInterface = new BSBGraphicInterface();
    }
    if (bsb.parameterList == null) {
        bsb.parameterList = new ParameterList();
    }
    if (bsb.opcodeList == null) {
        bsb.opcodeList = new OpcodeList();
    }
    bsb.graphicInterface.getRootGroup().setParameterList(bsb.parameterList);
    return bsb;
}
Also used : OpcodeList(blue.udo.OpcodeList) Element(electric.xml.Element) ParameterList(blue.automation.ParameterList) Elements(electric.xml.Elements)

Example 8 with ParameterList

use of blue.automation.ParameterList in project blue by kunstmusik.

the class BlueSynthBuilder method clearParameters.

/**
 * Clears Parameter settings. Used when a copy of this object is being made
 * by the user. Not implemented to do automatically on serialization as
 * BlueData is copied via serialization before rendering and all data must
 * stay valid.
 *
 * In 0.114.0, modified to also reset any subchannel dropdowns to MASTER
 */
public void clearParameters() {
    graphicInterface.getRootGroup().resetSubChannels();
    parameterList = new ParameterList();
    graphicInterface.getRootGroup().setParameterList(parameterList);
}
Also used : ParameterList(blue.automation.ParameterList)

Example 9 with ParameterList

use of blue.automation.ParameterList in project blue by kunstmusik.

the class Effect method clearParameters.

/**
 * Clears Parameter settings. Used when a copy of this object is being made
 * by the user. Not implemented to do automatically on serialization as
 * BlueData is copied via serialization before rendering and all data must
 * stay valid.
 */
public void clearParameters() {
    parameterList = new ParameterList();
    graphicInterface.getRootGroup().setParameterList(parameterList);
}
Also used : ParameterList(blue.automation.ParameterList)

Example 10 with ParameterList

use of blue.automation.ParameterList in project blue by kunstmusik.

the class Sound method setBlueSynthBuilder.

public void setBlueSynthBuilder(BlueSynthBuilder bsbObj) {
    if (this.bsbObj != null) {
        ParameterList paramList = bsbObj.getParameterList();
        paramList.removeListener(paramListListener);
    }
    ParameterList paramList = bsbObj.getParameterList();
    for (Parameter param : paramList) {
        adjustLineType(param);
    }
    paramList.addListener(paramListListener);
    this.bsbObj = bsbObj;
}
Also used : ParameterList(blue.automation.ParameterList) Parameter(blue.automation.Parameter)

Aggregations

ParameterList (blue.automation.ParameterList)11 Automatable (blue.automation.Automatable)5 Parameter (blue.automation.Parameter)5 InstrumentAssignment (blue.InstrumentAssignment)2 Channel (blue.mixer.Channel)2 ChannelList (blue.mixer.ChannelList)2 EffectsChain (blue.mixer.EffectsChain)2 Instrument (blue.orchestra.Instrument)2 OpcodeList (blue.udo.OpcodeList)2 Element (electric.xml.Element)2 Elements (electric.xml.Elements)2 ArrayList (java.util.ArrayList)2 BSBGraphicInterface (blue.orchestra.blueSynthBuilder.BSBGraphicInterface)1 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)1 HashSet (java.util.HashSet)1 Test (org.junit.Test)1