use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateKnobLEDs.
/**
* {@inheritDoc}
*/
@Override
public void updateKnobLEDs() {
final int upperBound = this.model.getValueChanger().getUpperBound();
final ICursorDevice cd = this.model.getCursorDevice();
final int extenderOffset = this.surface.getExtenderOffset();
final IParameterBank parameterBank = cd.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(extenderOffset + i);
this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_SINGLE_DOT, param.doesExist() ? Math.max(1, param.getValue()) : 0, upperBound);
}
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class MaschineParametersMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.doesExist()) {
d.notify("Please select a device...");
return;
}
// Row 1 & 2
final IParameterBank parameterBank = cd.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(i);
String name = param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 6) : "";
if (i == this.getSelectedParameter())
name = ">" + name;
d.setCell(0, i, name).setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(8), 8));
}
d.allDone();
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class ShiftView method scrollParameterBank.
private void scrollParameterBank(final boolean scrollBack, final ICursorDevice cursorDevice) {
final IParameterBank parameterBank = cursorDevice.getParameterBank();
if (scrollBack) {
if (!parameterBank.canScrollPageBackwards())
return;
parameterBank.scrollBackwards();
} else {
if (!parameterBank.canScrollPageForwards())
return;
parameterBank.scrollForwards();
}
this.mvHelper.notifySelectedParameterPage();
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class ControlMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ACVSDisplay d = (ACVSDisplay) this.surface.getDisplay();
final ACVSConfiguration configuration = this.surface.getConfiguration();
final boolean isForce = configuration.isActiveACVSDevice(ACVSDevice.FORCE);
final boolean isMPC = !isForce;
final boolean isMPC_X = configuration.isActiveACVSDevice(ACVSDevice.MPC_X);
final ITrackBank tb = this.model.getCurrentTrackBank();
final ICursorDevice device = this.model.getCursorDevice();
final int maxScene = calcMaxScene(this.model.getSceneBank());
d.setScreenItem(ScreenItem.TRACK_NUMBER_OF_SCENES, maxScene);
// Maximum number of sends
d.setScreenItem(ScreenItem.TRACK_SENDS_NO, calcNumberOfSends(tb));
for (int i = 0; i < 8; i++) {
// Send track data
final ITrack track = tb.getItem(i);
sendTrackData(d, i, track);
this.sendClipData(d, isMPC, i, track.getSlotBank());
}
this.sendSceneData(d, isMPC);
// Set device data
final boolean exists = device.doesExist();
final Optional<String> selectedPage = device.getParameterPageBank().getSelectedItem();
d.setRow(ACVSDisplay.ITEM_ID_DEVICE_BANK_NAME, exists ? selectedPage.orElse("") : "");
d.setRow(ACVSDisplay.ITEM_ID_DEVICE_NAME, exists ? device.getName() : "");
d.setScreenItem(ScreenItem.DEVICE_COUNT, device.doesExist() ? device.getDeviceBank().getItemCount() : 0);
final int devicePosition = device.getPosition();
d.setScreenItem(ScreenItem.CURRENT_DEVICE_INDEX, devicePosition >= 0 ? devicePosition : 0);
d.setScreenItem(ScreenItem.CURRENT_DEVICE_ACTIVE, device.isEnabled() ? 127 : 0);
final IParameterBank parameterBank = device.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(i);
d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAMETER_NAME_FIRST + i, param.getName());
d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAMETER_VALUE_FIRST + i, param.getDisplayedValue());
d.setScreenItem(ScreenItem.get(ScreenItem.DEVICE_PARAM1_ENABLED, i), param.doesExist() ? 127 : 0);
d.setScreenItem(ScreenItem.get(ScreenItem.DEVICE_PARAM1_VALUE, i), param.getValue());
if (isForce || isMPC_X) {
d.setScreenItem(ScreenItem.get(ScreenItem.KNOBSTYLE1_COLOR, 8 + i), param.doesExist() ? 1 : 0);
d.setScreenItem(ScreenItem.get(ScreenItem.KNOB_VALUE1, 8 + i), param.getValue());
d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_NAME1 + 8 + i, param.getName());
d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_VALUE1 + 8 + i, param.getDisplayedValue());
final ITrack track = tb.getItem(i);
d.setScreenItem(ScreenItem.get(ScreenItem.KNOBSTYLE1_COLOR, i), track.doesExist() ? 1 : 0);
d.setScreenItem(ScreenItem.get(ScreenItem.KNOB_VALUE1, i), track.getVolume());
d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_NAME1 + i, track.getName());
d.setRow(ACVSDisplay.ITEM_ID_DEVICE_PARAM_VALUE1 + i, track.getVolumeStr());
}
}
// Set transport data
final ITransport transport = this.model.getTransport();
d.setRow(ACVSDisplay.ITEM_ID_TEMPO, transport.getTempoParameter().getDisplayedValue());
d.setRow(ACVSDisplay.ITEM_ID_ARRANGEMENT_POSITION, transport.getBeatText().split(":")[0].replace('.', ':'));
d.setRow(ACVSDisplay.ITEM_ID_LOOP_START, transport.getLoopStartBeatText().split(":")[0].replace('.', ':'));
d.setRow(ACVSDisplay.ITEM_ID_LOOP_LENGTH, transport.getLoopLengthBeatText().split(":")[0].replace('.', ':'));
this.sendAdditionalMPCParameters(d);
if (!isMPC)
this.sendAdditionalForceParameters(d);
d.allDone();
if (this.currentMaxScene != maxScene) {
this.currentMaxScene = maxScene;
this.surface.forceFlush();
}
}
use of de.mossgrabers.framework.daw.data.bank.IParameterBank in project DrivenByMoss by git-moss.
the class BeatstepControllerSetup method updateIndication.
protected void updateIndication() {
final BeatstepControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
final boolean isTrack = viewManager.isActive(Views.TRACK);
final boolean isDevice = viewManager.isActive(Views.DEVICE);
final boolean isSession = viewManager.isActive(Views.SESSION);
final IMasterTrack mt = this.model.getMasterTrack();
mt.setVolumeIndication(!isDevice);
final ITrackBank tb = this.model.getTrackBank();
final Optional<ITrack> selectedTrack = tb.getSelectedItem();
final ITrackBank tbe = this.model.getEffectTrackBank();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final boolean isEffect = this.model.isEffectTrackBankActive();
tb.setIndication(!isEffect && isSession);
if (tbe != null)
tbe.setIndication(isEffect && isSession);
final IParameterBank parameterBank = cursorDevice.getParameterBank();
for (int i = 0; i < 8; i++) {
final boolean hasTrackSel = selectedTrack.isPresent() && selectedTrack.get().getIndex() == i;
final ITrack track = tb.getItem(i);
track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
final ISendBank sendBank = track.getSendBank();
for (int j = 0; j < 6; j++) sendBank.getItem(j).setIndication(!isEffect && hasTrackSel && isTrack);
if (tbe != null) {
final Optional<ITrack> selectedFXTrack = tbe.getSelectedItem();
final boolean hasFXTrackSel = selectedFXTrack.isPresent() && selectedFXTrack.get().getIndex() == i;
final ITrack fxTrack = tbe.getItem(i);
fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
}
parameterBank.getItem(i).setIndication(isDevice);
}
}
Aggregations