use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class SetupCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
final Modes mode = this.getMode();
if (modeManager.isActive(mode))
modeManager.restore();
else
modeManager.setTemporary(mode);
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class VolumeCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event != ButtonEvent.DOWN)
return;
final ModeManager modeManager = this.surface.getModeManager();
final Modes currentMode = modeManager.getActiveID();
// Layer mode selection for Push 1
final PushConfiguration config = this.surface.getConfiguration();
if (!config.isPush2() && this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
modeManager.setActive(Modes.DEVICE_LAYER_VOLUME);
return;
}
if (Modes.VOLUME.equals(currentMode)) {
if (this.model.getHost().supports(Capability.HAS_CROSSFADER))
modeManager.setActive(Modes.CROSSFADER);
} else
modeManager.setActive(Modes.VOLUME);
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class SelectCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
// Update for key combinations
this.surface.getViewManager().getActive().updateNoteMapping();
final ModeManager modeManager = this.surface.getModeManager();
// Don't do anything in browser mode
if (modeManager.isActive(Modes.BROWSER))
return;
if (event == ButtonEvent.DOWN) {
// Track or layer details?
if (Modes.isLayerMode(modeManager.getActiveID()))
modeManager.setActive(Modes.DEVICE_LAYER_DETAILS);
else
modeManager.setActive(Modes.TRACK_DETAILS);
} else if (event == ButtonEvent.UP && modeManager.isActive(Modes.TRACK_DETAILS, Modes.DEVICE_LAYER_DETAILS))
modeManager.restore();
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class SelectSessionViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
if (event == ButtonEvent.DOWN) {
this.isTemporary = false;
final ViewManager viewManager = this.surface.getViewManager();
final ModeManager modeManager = this.surface.getModeManager();
if (Views.isSessionView(viewManager.getActiveID())) {
if (modeManager.isActive(Modes.SESSION_VIEW_SELECT))
modeManager.restore();
else
modeManager.setTemporary(Modes.SESSION_VIEW_SELECT);
return;
}
// Switch to the preferred session view and display scene/clip mode if enabled
final PushConfiguration configuration = this.surface.getConfiguration();
viewManager.setActive(configuration.isScenesClipViewSelected() ? Views.SCENE_PLAY : Views.SESSION);
if (configuration.shouldDisplayScenesOrClips())
modeManager.setActive(Modes.SESSION);
return;
}
if (event == ButtonEvent.UP && this.isTemporary)
this.surface.getViewManager().restore();
}
use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class ShiftCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
final ModeManager modeManager = this.surface.getModeManager();
final Modes cm = modeManager.getActiveID();
if (event == ButtonEvent.DOWN && Modes.SCALES.equals(cm))
modeManager.setTemporary(Modes.SCALE_LAYOUT);
else if (event == ButtonEvent.UP && Modes.SCALE_LAYOUT.equals(cm))
modeManager.restore();
this.surface.setKnobSensitivityIsSlow(this.surface.isShiftPressed());
}
Aggregations