use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.
the class PanSendCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
final ModeManager modeManager = this.surface.getModeManager();
final Integer currentMode = modeManager.getActiveModeId();
// Layer mode selection for Push 1
Integer mode;
final PushConfiguration config = this.surface.getConfiguration();
if (!config.isPush2() && this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
if (this.model.isEffectTrackBankActive()) {
// No Sends on FX tracks
mode = Modes.MODE_DEVICE_LAYER_PAN;
} else {
mode = Integer.valueOf(currentMode.intValue() + 1);
// Wrap
if (mode.intValue() < Modes.MODE_DEVICE_LAYER_PAN.intValue() || mode.intValue() > Modes.MODE_DEVICE_LAYER_SEND6.intValue())
mode = Modes.MODE_DEVICE_LAYER_PAN;
// Check if Send channel exists
if (mode.intValue() >= Modes.MODE_DEVICE_LAYER_SEND1.intValue() && mode.intValue() <= Modes.MODE_DEVICE_LAYER_SEND6.intValue() && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_DEVICE_LAYER_SEND1.intValue()).doesExist())
mode = Modes.MODE_DEVICE_LAYER_PAN;
}
modeManager.setActiveMode(mode);
return;
}
if (this.model.isEffectTrackBankActive()) {
// No Sends on FX tracks
mode = Modes.MODE_PAN;
} else {
mode = Integer.valueOf(currentMode.intValue() + 1);
// Wrap
if (mode.intValue() < Modes.MODE_PAN.intValue() || mode.intValue() > Modes.MODE_SEND6.intValue())
mode = Modes.MODE_PAN;
// Check if Send channel exists
if (mode.intValue() >= Modes.MODE_SEND1.intValue() && mode.intValue() <= Modes.MODE_SEND6.intValue() && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_SEND1.intValue()).doesExist())
mode = Modes.MODE_PAN;
}
modeManager.setActiveMode(mode);
}
use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.
the class AccentCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event) {
switch(event) {
case DOWN:
this.quitAccentMode = false;
break;
case LONG:
this.quitAccentMode = true;
this.surface.getModeManager().setActiveMode(Modes.MODE_ACCENT);
break;
case UP:
if (this.quitAccentMode)
this.surface.getModeManager().restoreMode();
else {
final PushConfiguration config = this.surface.getConfiguration();
config.setAccentEnabled(!config.isAccentActive());
}
break;
}
}
use of de.mossgrabers.push.PushConfiguration in project DrivenByMoss by git-moss.
the class LayoutCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final ViewManager viewManager = this.surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY))
viewManager.setActiveView(Views.VIEW_PIANO);
else if (viewManager.isActiveView(Views.VIEW_PIANO))
viewManager.setActiveView(this.model.getHost().hasClips() ? Views.VIEW_DRUM64 : Views.VIEW_PLAY);
else if (viewManager.isActiveView(Views.VIEW_DRUM64))
viewManager.setActiveView(Views.VIEW_PLAY);
else if (viewManager.isActiveView(Views.VIEW_SEQUENCER))
viewManager.setActiveView(Views.VIEW_RAINDROPS);
else if (viewManager.isActiveView(Views.VIEW_RAINDROPS))
viewManager.setActiveView(Views.VIEW_DRUM);
else if (viewManager.isActiveView(Views.VIEW_DRUM))
viewManager.setActiveView(Views.VIEW_DRUM4);
else if (viewManager.isActiveView(Views.VIEW_DRUM4))
viewManager.setActiveView(Views.VIEW_DRUM8);
else if (viewManager.isActiveView(Views.VIEW_DRUM8))
viewManager.setActiveView(Views.VIEW_SEQUENCER);
else {
final PushConfiguration configuration = this.surface.getConfiguration();
if (viewManager.isActiveView(Views.VIEW_SESSION)) {
if (configuration.isFlipSession())
viewManager.setActiveView(Views.VIEW_SCENE_PLAY);
else
configuration.setFlipSession(true);
} else if (viewManager.isActiveView(Views.VIEW_SCENE_PLAY)) {
configuration.setFlipSession(false);
viewManager.setActiveView(Views.VIEW_SESSION);
}
}
}
use of de.mossgrabers.push.PushConfiguration 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.push.PushConfiguration 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();
}
Aggregations