use of de.mossgrabers.framework.configuration.Configuration in project DrivenByMoss by git-moss.
the class AbstractPlayView method initMaxVelocity.
/**
* Updates the velocity transition table based on the fixed accent value.
*/
protected void initMaxVelocity() {
final int[] maxVelocity = new int[128];
final Configuration config = this.surface.getConfiguration();
Arrays.fill(maxVelocity, Math.min(127, Math.max(0, config.getFixedAccentValue())));
maxVelocity[0] = 0;
this.surface.setVelocityTranslationTable(config.isAccentActive() ? maxVelocity : this.defaultVelocity);
}
use of de.mossgrabers.framework.configuration.Configuration 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());
}
}
use of de.mossgrabers.framework.configuration.Configuration 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