use of blue.automation.Automatable 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.Automatable in project blue by kunstmusik.
the class ParameterHelper method appendAllParametersFromChannel.
private static void appendAllParametersFromChannel(ArrayList<Parameter> params, Channel channel) {
EffectsChain pre = channel.getPreEffects();
for (int i = 0; i < pre.size(); i++) {
ParameterList list = ((Automatable) pre.getElementAt(i)).getParameterList();
params.addAll(list);
}
EffectsChain post = channel.getPostEffects();
for (int i = 0; i < post.size(); i++) {
ParameterList list = ((Automatable) post.getElementAt(i)).getParameterList();
params.addAll(list);
}
Parameter levelParameter = channel.getLevelParameter();
// if(!levelParameter.isAutomationEnabled()) {
// levelParameter.setCompilationVarName(channel.getName());
// }
params.add(levelParameter);
}
use of blue.automation.Automatable in project blue by kunstmusik.
the class ParameterHelper method clearChannelCompilationVar.
private static void clearChannelCompilationVar(Channel channel) {
channel.getLevelParameter().setCompilationVarName(null);
EffectsChain preEffectsChain = channel.getPreEffects();
for (int j = 0; j < preEffectsChain.size(); j++) {
Automatable automatable = (Automatable) preEffectsChain.getElementAt(j);
automatable.getParameterList().clearCompilationVarNames();
}
EffectsChain postEffectsChain = channel.getPostEffects();
for (int j = 0; j < postEffectsChain.size(); j++) {
Automatable automatable = (Automatable) postEffectsChain.getElementAt(j);
automatable.getParameterList().clearCompilationVarNames();
}
}
Aggregations