use of blue.automation.ParameterList 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.automation.ParameterList in project blue by kunstmusik.
the class ParameterHelper method getActiveParameters.
public static List<Parameter> getActiveParameters(Arrangement arr, Mixer mixer) {
List<Parameter> params = new ArrayList<>();
for (int i = 0; i < arr.size(); i++) {
InstrumentAssignment ia = arr.getInstrumentAssignment(i);
if (ia.enabled) {
Instrument instr = ia.instr;
if (instr instanceof Automatable) {
Automatable auto = (Automatable) instr;
ParameterList list = auto.getParameterList();
addActiveParametersFromList(params, list);
}
}
}
if (mixer != null && mixer.isEnabled()) {
List<Channel> channels = mixer.getAllSourceChannels();
for (Channel channel : channels) {
appendParametersFromChannel(params, channel);
}
ChannelList subChannels = mixer.getSubChannels();
for (Channel subChannel : subChannels) {
appendParametersFromChannel(params, subChannel);
}
appendParametersFromChannel(params, mixer.getMaster());
}
return params;
}
use of blue.automation.ParameterList in project blue by kunstmusik.
the class ParameterHelper method appendParametersFromChannel.
private static void appendParametersFromChannel(List<Parameter> params, Channel channel) {
EffectsChain pre = channel.getPreEffects();
for (int i = 0; i < pre.size(); i++) {
ParameterList list = ((Automatable) pre.getElementAt(i)).getParameterList();
addActiveParametersFromList(params, list);
}
EffectsChain post = channel.getPostEffects();
for (int i = 0; i < post.size(); i++) {
ParameterList list = ((Automatable) post.getElementAt(i)).getParameterList();
addActiveParametersFromList(params, list);
}
if (channel.getLevelParameter().isAutomationEnabled()) {
params.add(channel.getLevelParameter());
}
}
use of blue.automation.ParameterList in project blue by kunstmusik.
the class ParameterHelper method getAllParameters.
public static ArrayList<Parameter> getAllParameters(Arrangement arr, Mixer mixer) {
ArrayList<Parameter> params = new ArrayList<>();
for (int i = 0; i < arr.size(); i++) {
InstrumentAssignment ia = arr.getInstrumentAssignment(i);
if (ia.enabled) {
Instrument instr = ia.instr;
if (instr instanceof Automatable) {
Automatable auto = (Automatable) instr;
ParameterList list = auto.getParameterList();
params.addAll(list);
}
}
}
if (mixer != null && mixer.isEnabled()) {
List<Channel> channels = mixer.getAllSourceChannels();
for (Channel channel : channels) {
appendAllParametersFromChannel(params, channel);
}
ChannelList subChannels = mixer.getSubChannels();
for (Channel channel : subChannels) {
appendAllParametersFromChannel(params, channel);
}
appendAllParametersFromChannel(params, mixer.getMaster());
}
return params;
}
use of blue.automation.ParameterList in project blue by kunstmusik.
the class BSBGroupTest method testSetParameterList.
/**
* Test of setParameterList method, of class BSBGroup.
*/
@Test
public void testSetParameterList() {
System.out.println("setParameterList");
ParameterList paramList = new ParameterList();
BSBGroup instance = new BSBGroup();
instance.setUniqueNameManager(new UniqueNameManager());
instance.setAllSet(FXCollections.observableSet(new HashSet<>()));
instance.setParameterList(paramList);
BSBKnob knob = new BSBKnob();
knob.setObjectName("test1");
instance.addBSBObject(knob);
assertEquals(1, paramList.size());
instance.interfaceItemsProperty().remove(knob);
assertEquals(0, paramList.size());
BSBGroup subNode = new BSBGroup();
subNode.addBSBObject(knob);
knob.setAutomationAllowed(true);
instance.addBSBObject(subNode);
assertEquals(1, paramList.size());
subNode.interfaceItemsProperty().remove(knob);
assertEquals(0, paramList.size());
knob.setAutomationAllowed(true);
subNode.addBSBObject(knob);
assertEquals(1, paramList.size());
instance.interfaceItemsProperty().remove(subNode);
assertEquals(0, paramList.size());
}
Aggregations