use of de.mossgrabers.controller.arturia.beatstep.controller.BeatstepPadGrid in project DrivenByMoss by git-moss.
the class BeatstepControllerSetup method registerTriggerCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerTriggerCommands() {
final BeatstepControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
this.addButton(ButtonID.SHIFT, "Shift", (event, value) -> {
if (event == ButtonEvent.DOWN) {
viewManager.setActive(Views.SHIFT);
return;
}
if (event == ButtonEvent.UP) {
if (viewManager.isActive(Views.SHIFT))
viewManager.restore();
// Red LED is turned off on button release, restore the correct color
final BeatstepPadGrid beatstepPadGrid = (BeatstepPadGrid) surface.getPadGrid();
for (int note = 36; note < 52; note++) {
final LightInfo lightInfo = beatstepPadGrid.getLightInfo(note);
beatstepPadGrid.lightPad(note, lightInfo.getColor());
}
}
}, BeatstepControlSurface.BEATSTEP_SHIFT);
}
Aggregations