use of de.mossgrabers.framework.featuregroup.ModeManager in project DrivenByMoss by git-moss.
the class MastertrackTouchCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
final boolean isTouched = event != ButtonEvent.UP;
// Avoid accidentally leaving the browser
final ModeManager modeManager = this.surface.getModeManager();
if (modeManager.isActive(Modes.BROWSER))
return;
final IMasterTrack masterTrack = this.model.getMasterTrack();
masterTrack.touchVolume(isTouched);
if (this.surface.isDeletePressed()) {
this.surface.setTriggerConsumed(ButtonID.DELETE);
masterTrack.resetVolume();
return;
}
final boolean isMasterMode = modeManager.isActive(Modes.MASTER);
if (isTouched && isMasterMode)
return;
if (isTouched)
modeManager.setTemporary(Modes.MASTER_TEMP);
else if (!isMasterMode)
modeManager.restore();
}
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();
}
Aggregations