use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class PushControllerSetup method updateIndication.
private void updateIndication(final Integer mode) {
final ITrackBank tb = this.model.getTrackBank();
final IChannelBank tbe = this.model.getEffectTrackBank();
final PushControlSurface surface = this.getSurface();
final boolean isSession = surface.getViewManager().isActiveView(Views.VIEW_SESSION);
final boolean isEffect = this.model.isEffectTrackBankActive();
final boolean isPan = Modes.MODE_PAN.equals(mode);
final boolean isVolume = Modes.MODE_VOLUME.equals(mode);
tb.setIndication(!isEffect && isSession);
if (tbe != null)
tbe.setIndication(isEffect && isSession);
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final ITrack selectedTrack = tb.getSelectedTrack();
for (int i = 0; i < tb.getNumTracks(); i++) {
final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i && Modes.MODE_TRACK.equals(mode);
final ITrack track = tb.getTrack(i);
track.setVolumeIndication(!isEffect && (isVolume || hasTrackSel));
track.setPanIndication(!isEffect && (isPan || hasTrackSel));
for (int j = 0; j < tb.getNumSends(); j++) track.getSend(j).setIndication(!isEffect && (mode.intValue() - Modes.MODE_SEND1.intValue() == j || hasTrackSel));
if (tbe != null) {
final ITrack fxTrack = tbe.getTrack(i);
fxTrack.setVolumeIndication(isEffect);
fxTrack.setPanIndication(isEffect && isPan);
}
cursorDevice.indicateParameter(i, true);
}
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final ICursorDevice cd = this.model.getCursorDevice();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
if (!cd.hasSelectedDevice()) {
for (int i = 0; i < 8; i++) message.addOptionElement(i == 2 ? "Please select a device or press 'Add Device'..." : "", i == 7 ? "Up" : "", true, "", "", false, true);
display.send(message);
return;
}
final boolean noLayers = cd.hasLayers() && cd.hasZeroLayers();
if (noLayers) {
for (int i = 0; i < 8; i++) message.addOptionElement(i == 3 ? "Please create a " + (cd.hasDrumPads() ? "Drum Pad..." : "Device Layer...") : "", i == 7 ? "Up" : "", true, "", "", false, true);
display.send(message);
return;
}
this.updateMenu();
this.updateDisplayElements(message, cd, cd.getSelectedLayerOrDrumPad());
display.send(message);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay().clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasSelectedDevice()) {
d.setBlock(1, 0, " Select").setBlock(1, 1, "a device or press").setBlock(1, 2, "'Add Effect'... ").allDone();
return;
}
final boolean noLayers = cd.hasLayers() && cd.hasZeroLayers();
if (noLayers) {
d.setBlock(1, 1, " Please create").setBlock(1, 2, cd.hasDrumPads() ? "a Drum Pad..." : "a Device Layer...");
} else {
final IChannel l = cd.getSelectedLayerOrDrumPad();
if (l != null) {
d.setCell(0, 0, "Volume").setCell(1, 0, l.getVolumeStr(8)).setCell(2, 0, this.surface.getConfiguration().isEnableVUMeters() ? l.getVu() : l.getVolume(), Format.FORMAT_VALUE);
d.setCell(0, 1, "Pan").setCell(1, 1, l.getPanStr(8)).setCell(2, 1, l.getPan(), Format.FORMAT_PAN);
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
if (fxTrackBank == null) {
for (int i = 0; i < 6; i++) {
final int pos = 2 + i;
final ISend send = l.getSend(i);
d.setCell(0, pos, send.getName()).setCell(1, pos, send.getDisplayedValue(8)).setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
}
} else {
final boolean isFX = this.model.isEffectTrackBankActive();
for (int i = 0; i < 6; i++) {
final ITrack fxTrack = fxTrackBank.getTrack(i);
final boolean isEmpty = isFX || !fxTrack.doesExist();
final int pos = 2 + i;
if (isEmpty) {
d.clearCell(0, pos);
d.clearCell(2, pos);
} else {
final ISend send = l.getSend(i);
d.setCell(0, pos, fxTrack.getName()).setCell(1, pos, send.getDisplayedValue(8));
d.setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
}
}
}
}
}
this.drawRow4(d, cd);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLayerModePan method onValueKnob.
/**
* {@inheritDoc}
*/
@Override
public void onValueKnob(final int index, final int value) {
final ICursorDevice cd = this.model.getCursorDevice();
// Drum Pad Bank has size of 16, layers only 8
final int offset = getDrumPadIndex(cd);
final IChannel layer = cd.getLayerOrDrumPad(offset + index);
if (layer.doesExist())
cd.changeLayerOrDrumPadPan(offset + index, value);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLayerModePan method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1() {
final Display d = this.surface.getDisplay();
final ICursorDevice cd = this.model.getCursorDevice();
// Drum Pad Bank has size of 16, layers only 8
final int offset = getDrumPadIndex(cd);
for (int i = 0; i < 8; i++) {
final IChannel layer = cd.getLayerOrDrumPad(offset + i);
d.setCell(0, i, layer.doesExist() ? "Pan" : "").setCell(1, i, layer.getPanStr(8));
if (layer.doesExist())
d.setCell(2, i, layer.getPan(), Format.FORMAT_VALUE);
else
d.clearCell(2, i);
}
d.done(0).done(1).done(2);
this.drawRow4(d, cd);
}
Aggregations