Search in sources :

Example 1 with SessionView

use of de.mossgrabers.controller.ni.maschine.jam.view.SessionView in project DrivenByMoss by git-moss.

the class MaschineJamSessionViewCommand 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();
    if (event == ButtonEvent.UP) {
        // Toggle Arrange and Mix panel layout
        if (this.surface.isShiftPressed()) {
            final IApplication application = this.model.getApplication();
            final boolean isArrange = IApplication.PANEL_LAYOUT_ARRANGE.equals(application.getPanelLayout());
            application.setPanelLayout(isArrange ? IApplication.PANEL_LAYOUT_MIX : IApplication.PANEL_LAYOUT_ARRANGE);
            return;
        }
        if (viewManager.isActive(Views.SESSION)) {
            // Disable birds-eye-view if active
            if (sessionView.isBirdsEyeActive()) {
                sessionView.setBirdsEyeActive(false);
                this.notifyViewName(false, configuration.isFlipSession());
                return;
            }
            // Flip clips
            final boolean flipped = !configuration.isFlipSession();
            configuration.setFlipSession(flipped);
            this.notifyViewName(false, flipped);
            return;
        }
        // Activate session view
        viewManager.setActive(Views.SESSION);
        this.notifyViewName(false, configuration.isFlipSession());
    } else if (event == ButtonEvent.LONG) {
        // Only trigger birds-eye-view if session view is already active
        this.surface.setTriggerConsumed(ButtonID.SESSION);
        sessionView.setBirdsEyeActive(true);
        this.notifyViewName(true, configuration.isFlipSession());
    }
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) Configuration(de.mossgrabers.framework.configuration.Configuration) MaschineJamConfiguration(de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.ni.maschine.jam.view.SessionView)

Aggregations

MaschineJamConfiguration (de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration)1 SessionView (de.mossgrabers.controller.ni.maschine.jam.view.SessionView)1 Configuration (de.mossgrabers.framework.configuration.Configuration)1 IApplication (de.mossgrabers.framework.daw.IApplication)1 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)1