use of de.mossgrabers.framework.daw.data.IChannel 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.data.IChannel 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.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateSoloMenu.
protected void updateSoloMenu() {
for (int i = 0; i < 8; i++) {
final IChannel layer = this.bank.getItem(i);
this.menu.get(i).set(layer.doesExist() ? "Solo" : "", Boolean.valueOf(layer.isSolo()));
}
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerModeVolume method onKnobTouch.
/**
* {@inheritDoc}
*/
@Override
public void onKnobTouch(final int index, final boolean isTouched) {
this.isKnobTouched[index] = isTouched;
// Drum Pad Bank has size of 16, layers only 8
final int offset = this.getDrumPadIndex();
final IChannel layer = this.bank.getItem(offset + index);
if (!layer.doesExist())
return;
if (isTouched && this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
layer.resetVolume();
}
layer.touchVolume(isTouched);
this.checkStopAutomationOnKnobRelease(isTouched);
}
use of de.mossgrabers.framework.daw.data.IChannel in project DrivenByMoss by git-moss.
the class DeviceLayerMode method drawRow4.
/**
* Draw the fourth row.
*
* @param display The display
*/
protected void drawRow4(final ITextDisplay display) {
// Drum Pad Bank has size of 16, layers only 8
final int offset = this.getDrumPadIndex();
for (int i = 0; i < 8; i++) {
final IChannel layer = this.bank.getItem(offset + i);
final String n = StringUtils.shortenAndFixASCII(layer.getName(), layer.isSelected() ? 7 : 8);
display.setCell(3, i, layer.isSelected() ? Push1Display.SELECT_ARROW + n : n);
}
}
Aggregations