use of de.mossgrabers.sl.command.trigger.P2ButtonCommand in project DrivenByMoss by git-moss.
the class SLControllerSetup method registerTriggerCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerTriggerCommands() {
final SLControlSurface surface = this.getSurface();
for (int i = 0; i < 8; i++) {
this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW1_1.intValue() + i), SLControlSurface.MKII_BUTTON_ROW1_1 + i, new ButtonRowViewCommand<>(0, i, this.model, surface));
this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW2_1.intValue() + i), SLControlSurface.MKII_BUTTON_ROW2_1 + i, new ButtonRowViewCommand<>(1, i, this.model, surface));
this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW3_1.intValue() + i), SLControlSurface.MKII_BUTTON_ROW3_1 + i, new ButtonRowViewCommand<>(2, i, this.model, surface));
this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW4_1.intValue() + i), SLControlSurface.MKII_BUTTON_ROW4_1 + i, new ButtonRowViewCommand<>(3, i, this.model, surface));
this.addTriggerCommand(Integer.valueOf(Commands.COMMAND_ROW_SELECT_1.intValue() + i), SLControlSurface.MKII_BUTTON_ROWSEL1 + i, new ButtonRowSelectCommand<>(i, this.model, surface));
}
this.addTriggerCommand(Commands.COMMAND_REWIND, SLControlSurface.MKII_BUTTON_REWIND, new ButtonRowViewCommand<>(4, 0, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_FORWARD, SLControlSurface.MKII_BUTTON_FORWARD, new ButtonRowViewCommand<>(4, 1, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_STOP, SLControlSurface.MKII_BUTTON_STOP, new ButtonRowViewCommand<>(4, 2, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_PLAY, SLControlSurface.MKII_BUTTON_PLAY, new ButtonRowViewCommand<>(4, 3, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_LOOP, SLControlSurface.MKII_BUTTON_LOOP, new ButtonRowViewCommand<>(4, 4, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_RECORD, SLControlSurface.MKII_BUTTON_RECORD, new ButtonRowViewCommand<>(4, 6, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_LEFT, SLControlSurface.MKII_BUTTON_P1_UP, new P1ButtonCommand(true, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_RIGHT, SLControlSurface.MKII_BUTTON_P1_DOWN, new P1ButtonCommand(false, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_UP, SLControlSurface.MKII_BUTTON_P2_UP, new P2ButtonCommand(true, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_DOWN, SLControlSurface.MKII_BUTTON_P2_DOWN, new P2ButtonCommand(false, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_SELECT_PLAY_VIEW, SLControlSurface.MKII_BUTTON_TRANSPORT, new TransportButtonCommand(this.model, surface));
}
use of de.mossgrabers.sl.command.trigger.P2ButtonCommand 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();
}
}
use of de.mossgrabers.sl.command.trigger.P2ButtonCommand in project DrivenByMoss by git-moss.
the class PlayView method onButtonP1.
/**
* {@inheritDoc}
*/
@Override
public void onButtonP1(final boolean isUp, final ButtonEvent event) {
if (event != ButtonEvent.DOWN)
return;
final Integer activeModeId = this.surface.getModeManager().getActiveModeId();
if (activeModeId == Modes.MODE_SESSION) {
if (isUp)
this.model.getSceneBank().scrollScenesPageDown();
else
this.model.getSceneBank().scrollScenesPageUp();
return;
}
if (activeModeId == Modes.MODE_VOLUME) {
new P2ButtonCommand(isUp, this.model, this.surface).execute(event);
return;
}
if (activeModeId == Modes.MODE_TRACK || activeModeId == Modes.MODE_MASTER) {
new ButtonRowSelectCommand<>(3, this.model, this.surface).execute(event);
return;
}
if (activeModeId == Modes.MODE_PLAY_OPTIONS)
return;
final ModeManager modeManager = this.surface.getModeManager();
if (isUp)
((DeviceParamsMode) modeManager.getMode(Modes.MODE_PARAMS)).nextPage();
else
((DeviceParamsMode) modeManager.getMode(Modes.MODE_PARAMS)).previousPage();
}
Aggregations