use of de.mossgrabers.controller.novation.launchpad.view.SessionView in project DrivenByMoss by git-moss.
the class SelectSessionViewCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final ButtonEvent event, final int velocity) {
final ViewManager viewManager = this.surface.getViewManager();
final SessionView sessionView = (SessionView) viewManager.get(Views.SESSION);
final Configuration configuration = this.surface.getConfiguration();
switch(event) {
case DOWN:
this.temporaryMode = TemporaryMode.OFF;
// Display Mix view with Shift
if (this.surface.isShiftPressed()) {
this.surface.setTriggerConsumed(ButtonID.SESSION);
viewManager.setActive(Views.MIX);
this.notifyViewName(Views.MIX, false, false);
}
break;
case LONG:
// Only trigger birds-eye-view if session view is already active
if (viewManager.isActive(Views.SESSION)) {
if (this.temporaryMode != TemporaryMode.POSSIBLE) {
this.surface.setTriggerConsumed(ButtonID.SESSION);
sessionView.setBirdsEyeActive(true);
this.notifyViewName(Views.SESSION, true, configuration.isFlipSession());
}
return;
}
this.activatedView(viewManager, configuration);
break;
case UP:
if (this.temporaryMode == TemporaryMode.ACTIVE) {
this.surface.getViewManager().restore();
return;
}
if (this.temporaryMode == TemporaryMode.POSSIBLE)
return;
if (viewManager.isActive(Views.SESSION)) {
// Disable birds-eye-view if active
if (sessionView.isBirdsEyeActive()) {
sessionView.setBirdsEyeActive(false);
this.notifyViewName(Views.SESSION, false, configuration.isFlipSession());
return;
}
// Flip clips
final boolean flipped = !configuration.isFlipSession();
configuration.setFlipSession(flipped);
this.notifyViewName(Views.SESSION, false, flipped);
return;
}
this.activatedView(viewManager, configuration);
break;
}
}
Aggregations