use of blue.automation.Parameter 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.Parameter in project blue by kunstmusik.
the class SoundEditor method editScoreObject.
@Override
public final void editScoreObject(ScoreObject sObj) {
if (sObj == null) {
this.sObj = null;
editorLabel.setText("no editor available");
editor.editInstrument(null);
return;
}
if (!(sObj instanceof Sound)) {
this.sObj = null;
editorLabel.setText("no editor available");
editor.editInstrument(null);
return;
}
if (this.sObj != null) {
final Sound temp = this.sObj;
BlueFX.runOnFXThread(() -> {
temp.commentProperty().unbind();
temp.removeScoreObjectListener(sObjListener);
});
}
this.sObj = (Sound) sObj;
editor.editInstrument(this.sObj.getBlueSynthBuilder());
BlueFX.runOnFXThread(() -> {
lineList.clear();
int colorCount = 0;
for (Parameter p : this.sObj.getBlueSynthBuilder().getParameterList().sorted()) {
if (p.isAutomationEnabled()) {
p.getLine().setVarName(p.getName());
p.getLine().setColor(LineColors.getColor(colorCount++));
List<LinePoint> points = p.getLine().getObservableList();
if (points.size() < 2) {
LinePoint lp = new LinePoint();
lp.setLocation(1.0, points.get(0).getY());
points.add(lp);
}
lineList.add(p.getLine());
}
}
lineView.setStartTime(this.sObj.getStartTime());
lineView.setDuration(this.sObj.getSubjectiveDuration());
commentTextArea.setText(this.sObj.getComment());
this.sObj.commentProperty().bind(commentTextArea.textProperty());
this.sObj.addScoreObjectListener(sObjListener);
});
}
use of blue.automation.Parameter in project blue by kunstmusik.
the class SoundLayerPanel method paramColorSelectPropertyChange.
// GEN-LAST:event_otherMenuButtonActionPerformed
private void paramColorSelectPropertyChange(java.beans.PropertyChangeEvent evt) {
// GEN-FIRST:event_paramColorSelectPropertyChange
if (sLayer == null || paramIdList == null || updating) {
return;
}
int index = paramIdList.getSelectedIndex();
if (index < 0) {
return;
}
String id = paramIdList.getParameterId(index);
Parameter param = AutomationManager.getInstance().getParameter(id);
if (param != null) {
param.getLine().setColor(paramColorSelect.getColor());
}
}
use of blue.automation.Parameter in project blue by kunstmusik.
the class MixerTest method testSaveParam.
public void testSaveParam() {
Parameter p = new Parameter();
Parameter clone = new Parameter(p);
System.out.println(p + ":" + clone);
assertEquals(p, clone);
}
use of blue.automation.Parameter in project blue by kunstmusik.
the class BSBVSliderBank method setupForCompilation.
/*
* (non-Javadoc)
*
* @see blue.orchestra.blueSynthBuilder.BSBObject#setupForCompilation(blue.orchestra.blueSynthBuilder.BSBCompilationUnit)
*/
@Override
public void setupForCompilation(BSBCompilationUnit compilationUnit) {
Object[] vals = new Object[2];
vals[0] = getObjectName();
for (int i = 0; i < sliders.size(); i++) {
BSBVSlider slider = sliders.get(i);
vals[1] = new Integer(i);
String key = KEY_FMT.format(vals);
if (parameters != null) {
Parameter param = parameters.getParameter(key);
if (param != null && param.getCompilationVarName() != null) {
compilationUnit.addReplacementValue(key, param.getCompilationVarName());
continue;
}
}
compilationUnit.addReplacementValue(key, NumberUtilities.formatDouble(slider.getValue()));
}
}
Aggregations