Search in sources :

Example 1 with ButtonRowSelectCommand

use of de.mossgrabers.sl.command.trigger.ButtonRowSelectCommand in project DrivenByMoss by git-moss.

the class ControlView method onButtonP1.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonP1(final boolean isUp, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Integer activeModeId = modeManager.getActiveModeId();
    if (activeModeId == Modes.MODE_FUNCTIONS || activeModeId == Modes.MODE_FIXED)
        this.onButtonRow1Select();
    else if (activeModeId == Modes.MODE_VOLUME)
        new P2ButtonCommand(isUp, this.model, this.surface).execute(event);
    else if (activeModeId == Modes.MODE_TRACK || activeModeId == Modes.MODE_MASTER)
        new ButtonRowSelectCommand<>(3, this.model, this.surface).execute(event);
    else if (activeModeId == Modes.MODE_TRACK_TOGGLES || activeModeId == Modes.MODE_FRAME)
        this.onButtonRow2Select();
    else {
        if (isUp)
            ((DeviceParamsMode) modeManager.getMode(Modes.MODE_PARAMS)).nextPage();
        else
            ((DeviceParamsMode) modeManager.getMode(Modes.MODE_PARAMS)).previousPage();
    }
}
Also used : ButtonRowSelectCommand(de.mossgrabers.sl.command.trigger.ButtonRowSelectCommand) P2ButtonCommand(de.mossgrabers.sl.command.trigger.P2ButtonCommand) DeviceParamsMode(de.mossgrabers.sl.mode.device.DeviceParamsMode) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Aggregations

ModeManager (de.mossgrabers.framework.mode.ModeManager)1 ButtonRowSelectCommand (de.mossgrabers.sl.command.trigger.ButtonRowSelectCommand)1 P2ButtonCommand (de.mossgrabers.sl.command.trigger.P2ButtonCommand)1 DeviceParamsMode (de.mossgrabers.sl.mode.device.DeviceParamsMode)1