Search in sources :

Example 1 with SessionView

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;
    }
}
Also used : Configuration(de.mossgrabers.framework.configuration.Configuration) LaunchpadConfiguration(de.mossgrabers.controller.novation.launchpad.LaunchpadConfiguration) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.novation.launchpad.view.SessionView)

Aggregations

LaunchpadConfiguration (de.mossgrabers.controller.novation.launchpad.LaunchpadConfiguration)1 SessionView (de.mossgrabers.controller.novation.launchpad.view.SessionView)1 Configuration (de.mossgrabers.framework.configuration.Configuration)1 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)1