Search in sources :

Example 1 with BeatstepPadGrid

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);
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) BeatstepControlSurface(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface) BeatstepPadGrid(de.mossgrabers.controller.arturia.beatstep.controller.BeatstepPadGrid) LightInfo(de.mossgrabers.framework.controller.grid.LightInfo)

Aggregations

BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)1 BeatstepPadGrid (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepPadGrid)1 LightInfo (de.mossgrabers.framework.controller.grid.LightInfo)1 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)1