use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class APCQuantizeCommand method executeShifted.
/**
* {@inheritDoc}
*/
@Override
public void executeShifted(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ICursorDevice cursorDevice = this.model.getCursorDevice();
if (cursorDevice.hasSelectedDevice()) {
final boolean pinned = cursorDevice.isPinned();
cursorDevice.togglePinned();
final boolean cursorTrackPinned = this.model.isCursorTrackPinned();
if (pinned == cursorTrackPinned)
this.model.toggleCursorTrackPinned();
}
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLeftCommand method executeShifted.
/**
* {@inheritDoc}
*/
@Override
public void executeShifted(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
// Exit layer
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel layer = cd.getSelectedLayerOrDrumPad();
if (!cd.hasLayers() || layer == null) {
if (cd.isNested()) {
cd.selectParent();
cd.selectChannel();
}
} else
layer.setSelected(false);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class BeatstepControllerSetup method updateIndication.
private void updateIndication() {
final BeatstepControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
final boolean isTrack = viewManager.isActiveView(Views.VIEW_TRACK);
final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
final boolean isSession = viewManager.isActiveView(Views.VIEW_SESSION);
final IMasterTrack mt = this.model.getMasterTrack();
mt.setVolumeIndication(!isDevice);
final ITrackBank tb = this.model.getTrackBank();
final ITrack selectedTrack = tb.getSelectedTrack();
final IChannelBank tbe = this.model.getEffectTrackBank();
final ITrack selectedFXTrack = tbe.getSelectedTrack();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final boolean isEffect = this.model.isEffectTrackBankActive();
tb.setIndication(!isEffect && isSession);
tbe.setIndication(isEffect && isSession);
for (int i = 0; i < 8; i++) {
final boolean hasTrackSel = selectedTrack != null && selectedTrack.getIndex() == i;
final ITrack track = tb.getTrack(i);
track.setVolumeIndication(!isEffect && hasTrackSel && !isDevice);
track.setPanIndication(!isEffect && hasTrackSel && !isDevice);
for (int j = 0; j < 6; j++) track.getSend(j).setIndication(!isEffect && hasTrackSel && isTrack);
final boolean hasFXTrackSel = selectedFXTrack != null && selectedFXTrack.getIndex() == i;
final ITrack fxTrack = tbe.getTrack(i);
fxTrack.setVolumeIndication(isEffect && hasFXTrackSel && isTrack);
fxTrack.setPanIndication(isEffect && hasFXTrackSel && isTrack);
cursorDevice.indicateParameter(i, isDevice);
}
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class AbstractDrumView method onDeactivate.
/**
* {@inheritDoc}
*/
@Override
public void onDeactivate() {
super.onDeactivate();
final ICursorDevice primary = this.model.getPrimaryDevice();
primary.enableObservers(false);
primary.setDrumPadIndication(false);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class AbstractDrumView64 method drawGrid.
/**
* {@inheritDoc}
*/
@Override
public void drawGrid() {
if (!this.model.canSelectedTrackHoldNotes()) {
this.surface.getPadGrid().turnOff();
return;
}
// halfColumns x playLines Drum Pad Grid
final ICursorDevice drumDevice64 = this.model.getDrumDevice64();
final boolean hasDrumPads = drumDevice64.hasDrumPads();
boolean isSoloed = false;
final int numPads = this.rows * this.columns;
if (hasDrumPads) {
for (int i = 0; i < numPads; i++) {
if (drumDevice64.getDrumPad(i).isSolo()) {
isSoloed = true;
break;
}
}
}
final boolean isRecording = this.model.hasRecordingState();
for (int index = 0; index < numPads; index++) {
final int x = index / 32 * 4 + index % 4;
final int y = index / 4 % 8;
this.surface.getPadGrid().lightEx(x, 7 - y, this.getPadColor(index, drumDevice64, isSoloed, isRecording));
}
}
Aggregations