Search in sources :

Example 1 with ViewMultiSelectCommand

use of de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand in project DrivenByMoss by git-moss.

the class LaunchkeyMiniMk3ControllerSetup method createViewButton.

private void createViewButton(final ButtonID buttonID, final OutputID outputID, final String label, final Views view, final int viewIndex) {
    final LaunchkeyMiniMk3ControlSurface surface = this.getSurface();
    final ViewMultiSelectCommand<LaunchkeyMiniMk3ControlSurface, LaunchkeyMiniMk3Configuration> viewSelectCommand = new ViewMultiSelectCommand<>(this.model, surface, true, view);
    this.addButton(surface, buttonID, label, (event, velocity) -> {
        viewSelectCommand.executeNormal(event);
        surface.getPadGrid().setView(view);
    }, 15, LaunchkeyMiniMk3ControlSurface.LAUNCHKEY_VIEW_SELECT, viewIndex, false, null);
    final IHwLight light = surface.createLight(outputID, () -> surface.getViewManager().isActive(view) ? ColorEx.ORANGE : ColorEx.DARK_ORANGE, color -> {
    // Intentionally empty
    });
    surface.getButton(buttonID).addLight(light);
}
Also used : ViewMultiSelectCommand(de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand) LaunchkeyMiniMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface) IHwLight(de.mossgrabers.framework.controller.hardware.IHwLight)

Example 2 with ViewMultiSelectCommand

use of de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand in project DrivenByMoss by git-moss.

the class LaunchkeyMk3ControllerSetup method createViewButton.

private void createViewButton(final ButtonID buttonID, final OutputID outputID, final String label, final Views view, final int viewIndex) {
    final LaunchkeyMk3ControlSurface surface = this.getSurface();
    final ViewMultiSelectCommand<LaunchkeyMk3ControlSurface, LaunchkeyMk3Configuration> viewSelectCommand = new ViewMultiSelectCommand<>(this.model, surface, true, view);
    this.addButton(surface, buttonID, label, (event, velocity) -> {
        viewSelectCommand.executeNormal(event);
        if (event == ButtonEvent.DOWN)
            surface.getPadGrid().setView(view);
    }, 15, LaunchkeyMk3ControlSurface.LAUNCHKEY_VIEW_SELECT, viewIndex, false, null);
    final IHwLight light = surface.createLight(outputID, () -> surface.getViewManager().isActive(view) ? ColorEx.ORANGE : ColorEx.DARK_ORANGE, color -> {
    // Intentionally empty
    });
    surface.getButton(buttonID).addLight(light);
}
Also used : ViewMultiSelectCommand(de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand) LaunchkeyMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface) IHwLight(de.mossgrabers.framework.controller.hardware.IHwLight)

Aggregations

ViewMultiSelectCommand (de.mossgrabers.framework.command.trigger.view.ViewMultiSelectCommand)2 IHwLight (de.mossgrabers.framework.controller.hardware.IHwLight)2 LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)1 LaunchkeyMiniMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)1