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