use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceLayerModeSend 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);
final int sendIndex = this.getCurrentSendIndex();
for (int i = 0; i < 8; i++) {
final IChannel layer = cd.getLayerOrDrumPad(offset + i);
final boolean exists = layer.doesExist();
final ISend send = layer.getSend(sendIndex);
d.setCell(0, i, exists ? send.getName() : "").setCell(1, i, send.getDisplayedValue(8));
if (exists)
d.setCell(2, i, send.getValue(), Format.FORMAT_VALUE);
else
d.clearCell(2, i);
}
d.done(0).done(1).done(2);
this.drawRow4(d, cd);
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class ColorView method onGridNote.
/**
* {@inheritDoc}
*/
@Override
public void onGridNote(final int note, final int velocity) {
if (velocity == 0)
return;
final int color = note - 36;
if (color < BitwigColors.BITWIG_COLORS.length) {
final double[] entry = BitwigColors.getColorEntry(BitwigColors.BITWIG_COLORS[color]);
switch(this.mode) {
case MODE_TRACK:
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t = tb.getSelectedTrack();
if (t == null) {
final IMasterTrack master = this.model.getMasterTrack();
if (master.isSelected())
master.setColor(entry[0], entry[1], entry[2]);
} else
t.setColor(entry[0], entry[1], entry[2]);
break;
case MODE_LAYER:
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel deviceChain = cd.getSelectedLayerOrDrumPad();
cd.setLayerOrDrumPadColor(deviceChain.getIndex(), entry[0], entry[1], entry[2]);
break;
case MODE_CLIP:
final ICursorClip clip = this.model.getCursorClip();
if (clip != null)
clip.setColor(entry[0], entry[1], entry[2]);
break;
}
}
this.surface.getViewManager().restoreView();
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class MuteCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
// Update for key combinations
this.surface.getViewManager().getActiveView().updateNoteMapping();
final PushConfiguration config = this.surface.getConfiguration();
if (!config.isPush2()) {
config.setTrackState(TrackState.MUTE);
return;
}
// Toggle mute lock mode
if (this.surface.isShiftPressed()) {
if (event == ButtonEvent.UP)
config.setMuteSoloLocked(!config.isMuteSoloLocked());
return;
}
// Behaviour like Push 1
if (config.isMuteSoloLocked()) {
config.setTrackState(TrackState.MUTE);
return;
}
if (event == ButtonEvent.DOWN) {
config.setIsMuteLongPressed(false);
return;
}
if (event == ButtonEvent.LONG) {
config.setIsMuteLongPressed(true);
config.setTrackState(TrackState.MUTE);
return;
}
if (config.isMuteLongPressed()) {
config.setIsMuteLongPressed(false);
return;
}
final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
if (Modes.isTrackMode(activeModeId)) {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selTrack = tb.getSelectedTrack();
if (selTrack != null)
selTrack.toggleMute();
} else if (Modes.isLayerMode(activeModeId)) {
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel layer = cd.getSelectedLayerOrDrumPad();
if (layer != null)
cd.toggleLayerOrDrumPadMute(layer.getIndex());
} else if (activeModeId == Modes.MODE_MASTER)
this.model.getMasterTrack().toggleMute();
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class SoloCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
// Update for key combinations
this.surface.getViewManager().getActiveView().updateNoteMapping();
final PushConfiguration config = this.surface.getConfiguration();
if (!config.isPush2()) {
config.setTrackState(TrackState.SOLO);
return;
}
// Toggle solo lock mode
if (this.surface.isShiftPressed()) {
if (event == ButtonEvent.UP)
config.setMuteSoloLocked(!config.isMuteSoloLocked());
return;
}
// Behaviour like Push 1
if (config.isMuteSoloLocked()) {
config.setTrackState(TrackState.SOLO);
return;
}
if (event == ButtonEvent.DOWN) {
config.setIsSoloLongPressed(false);
return;
}
if (event == ButtonEvent.LONG) {
config.setIsSoloLongPressed(true);
config.setTrackState(TrackState.SOLO);
return;
}
if (config.isSoloLongPressed()) {
config.setIsSoloLongPressed(false);
return;
}
final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
if (Modes.isTrackMode(activeModeId)) {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selTrack = tb.getSelectedTrack();
if (selTrack != null)
selTrack.toggleSolo();
} else if (Modes.isLayerMode(activeModeId)) {
final ICursorDevice cd = this.model.getCursorDevice();
final IChannel layer = cd.getSelectedLayerOrDrumPad();
if (layer != null)
cd.toggleLayerOrDrumPadSolo(layer.getIndex());
} else if (activeModeId == Modes.MODE_MASTER)
this.model.getMasterTrack().toggleSolo();
}
use of de.mossgrabers.framework.daw.ICursorDevice in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Display d = this.surface.getDisplay().clearRow(0).clearRow(2);
final ICursorDevice cd = this.model.getCursorDevice();
if (cd.hasSelectedDevice()) {
for (int i = 0; i < 8; i++) {
final IParameter param = cd.getFXParam(i);
d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 8) : "").setCell(2, i, param.getDisplayedValue(8));
}
} else
d.setRow(0, " Please select a device... ");
d.done(0).done(2);
}
Aggregations