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());
}
}
Aggregations