Search in sources :

Example 1 with TempoCommand

use of de.mossgrabers.framework.command.continuous.TempoCommand in project DrivenByMoss by git-moss.

the class APCControllerSetup method registerContinuousCommands.

/**
 * {@inheritDoc}
 */
@Override
protected void registerContinuousCommands() {
    final APCControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    this.addContinuousCommand(Commands.CONT_COMMAND_MASTER_KNOB, APCControlSurface.APC_KNOB_MASTER_LEVEL, new MasterFaderAbsoluteCommand<>(this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_PLAY_POSITION, APCControlSurface.APC_KNOB_CUE_LEVEL, new PlayPositionCommand<>(this.model, surface));
    this.addContinuousCommand(Commands.CONT_COMMAND_CROSSFADER, APCControlSurface.APC_KNOB_CROSSFADER, new CrossfaderCommand<>(this.model, surface));
    for (int i = 0; i < 8; i++) {
        final Integer faderCommand = Integer.valueOf(Commands.CONT_COMMAND_FADER1.intValue() + i);
        viewManager.registerContinuousCommand(faderCommand, new FaderAbsoluteCommand<>(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_TRACK_LEVEL, i, faderCommand);
        final Integer knobCommand = Integer.valueOf(Commands.CONT_COMMAND_KNOB1.intValue() + i);
        viewManager.registerContinuousCommand(knobCommand, new KnobRowModeCommand<>(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_TRACK_KNOB_1 + i, knobCommand);
        final Integer deviceKnobCommand = Integer.valueOf(Commands.CONT_COMMAND_DEVICE_KNOB1.intValue() + i);
        viewManager.registerContinuousCommand(deviceKnobCommand, new DeviceKnobRowCommand(i, this.model, surface));
        surface.assignContinuousCommand(APCControlSurface.APC_KNOB_DEVICE_KNOB_1 + i, deviceKnobCommand);
    }
    if (this.isMkII)
        this.addContinuousCommand(Commands.CONT_COMMAND_TEMPO, APCControlSurface.APC_KNOB_TEMPO, new TempoCommand<>(this.model, surface));
}
Also used : APCControlSurface(de.mossgrabers.apc.controller.APCControlSurface) ViewManager(de.mossgrabers.framework.view.ViewManager) TempoCommand(de.mossgrabers.framework.command.continuous.TempoCommand) TapTempoCommand(de.mossgrabers.framework.command.trigger.transport.TapTempoCommand) DeviceKnobRowCommand(de.mossgrabers.apc.command.continuous.DeviceKnobRowCommand)

Aggregations

DeviceKnobRowCommand (de.mossgrabers.apc.command.continuous.DeviceKnobRowCommand)1 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)1 TempoCommand (de.mossgrabers.framework.command.continuous.TempoCommand)1 TapTempoCommand (de.mossgrabers.framework.command.trigger.transport.TapTempoCommand)1 ViewManager (de.mossgrabers.framework.view.ViewManager)1