use of de.mossgrabers.framework.command.trigger.ModeSelectCommand in project DrivenByMoss by git-moss.
the class APCControllerSetup method registerTriggerCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerTriggerCommands() {
final APCControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
this.addTriggerCommand(Commands.COMMAND_SHIFT, APCControlSurface.APC_BUTTON_SHIFT, new ShiftCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_PLAY, APCControlSurface.APC_BUTTON_PLAY, new PlayCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_RECORD, APCControlSurface.APC_BUTTON_RECORD, new APCRecordCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_TAP_TEMPO, APCControlSurface.APC_BUTTON_TAP_TEMPO, new TapTempoCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_QUANTIZE, APCControlSurface.APC_BUTTON_REC_QUANT, new APCQuantizeCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_PAN_SEND, APCControlSurface.APC_BUTTON_PAN, new ModeSelectCommand<>(Modes.MODE_PAN, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_MASTERTRACK, APCControlSurface.APC_BUTTON_MASTER, new MasterCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_STOP_ALL_CLIPS, APCControlSurface.APC_BUTTON_STOP_ALL_CLIPS, new StopAllClipsCommand<>(this.model, surface));
this.addTriggerCommand(Integer.valueOf(COMMAND_SEND), APCControlSurface.APC_BUTTON_SEND_A, new SendCommand(0, this.model, surface));
this.addTriggerCommand(Integer.valueOf(COMMAND_SEND + 1), APCControlSurface.APC_BUTTON_SEND_B, new SendCommand(1, this.model, surface));
for (int i = 0; i < 8; i++) {
final Integer selectCommand = Integer.valueOf(COMMAND_SELECT + i);
final Integer soloCommand = Integer.valueOf(COMMAND_SOLO + i);
final Integer muteCommand = Integer.valueOf(COMMAND_MUTE + i);
final Integer recArmCommand = Integer.valueOf(COMMAND_REC_ARM + i);
final Integer crossfadeCommand = Integer.valueOf(COMMAND_CROSSFADER + i);
final Integer stopClipCommand = Integer.valueOf(COMMAND_STOP_CLIP + i);
viewManager.registerTriggerCommand(selectCommand, new SelectCommand(i, this.model, surface));
viewManager.registerTriggerCommand(soloCommand, new SoloCommand<>(i, this.model, surface));
viewManager.registerTriggerCommand(muteCommand, new MuteCommand<>(i, this.model, surface));
viewManager.registerTriggerCommand(recArmCommand, new RecArmCommand(i, this.model, surface));
viewManager.registerTriggerCommand(crossfadeCommand, new CrossfadeModeCommand<>(i, this.model, surface));
viewManager.registerTriggerCommand(stopClipCommand, new StopClipCommand<>(i, this.model, surface));
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_TRACK_SELECTION, i, selectCommand);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_SOLO, i, soloCommand);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_ACTIVATOR, i, muteCommand);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_RECORD_ARM, i, recArmCommand);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_A_B, i, crossfadeCommand);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_CLIP_STOP, i, stopClipCommand);
}
viewManager.registerTriggerCommand(COMMAND_DEVICE_LEFT, new DeviceLeftCommand(this.model, surface));
viewManager.registerTriggerCommand(COMMAND_DEVICE_RIGHT, new DeviceRightCommand(this.model, surface));
viewManager.registerTriggerCommand(Commands.COMMAND_CLIP, new SessionRecordCommand(this.model, surface));
viewManager.registerTriggerCommand(Commands.COMMAND_METRONOME, new MetronomeCommand<>(this.model, surface));
viewManager.registerTriggerCommand(Commands.COMMAND_NUDGE_MINUS, new NudgeCommand(true, this.model, surface));
viewManager.registerTriggerCommand(Commands.COMMAND_NUDGE_PLUS, new NudgeCommand(false, this.model, surface));
viewManager.registerTriggerCommand(Commands.COMMAND_LAYOUT, new PanelLayoutCommand(this.model, surface));
viewManager.registerTriggerCommand(Commands.COMMAND_DEVICE_ON_OFF, new DeviceOnOffCommand<>(this.model, surface));
viewManager.registerTriggerCommand(COMMAND_TOGGLE_DEVICES, new PaneCommand<>(Panels.DEVICE, this.model, surface));
if (this.isMkII) {
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_SESSION, Commands.COMMAND_CLIP);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_SEND_C, Commands.COMMAND_METRONOME);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_NUDGE_MINUS, Commands.COMMAND_NUDGE_MINUS);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_NUDGE_PLUS, Commands.COMMAND_NUDGE_PLUS);
// Detail View
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_METRONOME, Commands.COMMAND_LAYOUT);
// Device on/off
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_DETAIL_VIEW, Commands.COMMAND_DEVICE_ON_OFF);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_CLIP_TRACK, COMMAND_DEVICE_LEFT);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, COMMAND_DEVICE_RIGHT);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_MIDI_OVERDUB, COMMAND_TOGGLE_DEVICES);
} else {
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_MIDI_OVERDUB, Commands.COMMAND_CLIP);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_METRONOME, Commands.COMMAND_METRONOME);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_NUDGE_PLUS, Commands.COMMAND_NUDGE_MINUS);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_NUDGE_MINUS, Commands.COMMAND_NUDGE_PLUS);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_DETAIL_VIEW, Commands.COMMAND_LAYOUT);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_DEVICE_ON_OFF, Commands.COMMAND_DEVICE_ON_OFF);
surface.assignTriggerCommand(APCControlSurface.APC_BUTTON_CLIP_TRACK, COMMAND_TOGGLE_DEVICES);
this.addTriggerCommand(Commands.COMMAND_STOP, APCControlSurface.APC_BUTTON_STOP, new StopCommand<>(this.model, surface));
this.addTriggerCommand(Integer.valueOf(COMMAND_SEND + 2), APCControlSurface.APC_BUTTON_SEND_C, new SendCommand(2, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_NEW, APCControlSurface.APC_FOOTSWITCH_2, new NewCommand<>(this.model, surface));
}
this.addTriggerCommand(Commands.COMMAND_BROWSE, APCControlSurface.APC_BUTTON_BANK, new APCBrowserCommand(this.model, surface));
this.addTriggerCommand(COMMAND_BANK_LEFT, APCControlSurface.APC_BUTTON_DEVICE_LEFT, new BankLeftCommand(this.model, surface));
this.addTriggerCommand(COMMAND_BANK_RIGHT, APCControlSurface.APC_BUTTON_DEVICE_RIGHT, new BankRightCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_DOWN, surface.getDownButtonId(), new APCCursorCommand(Direction.DOWN, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_UP, surface.getUpButtonId(), new APCCursorCommand(Direction.UP, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_LEFT, surface.getLeftButtonId(), new APCCursorCommand(Direction.LEFT, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_RIGHT, surface.getRightButtonId(), new APCCursorCommand(Direction.RIGHT, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_SCENE1, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_1, new SceneCommand<>(7, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_SCENE2, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_2, new SceneCommand<>(6, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_SCENE3, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_3, new SceneCommand<>(5, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_SCENE4, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_4, new SceneCommand<>(4, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_SCENE5, APCControlSurface.APC_BUTTON_SCENE_LAUNCH_5, new SceneCommand<>(3, this.model, surface));
}
use of de.mossgrabers.framework.command.trigger.ModeSelectCommand in project DrivenByMoss by git-moss.
the class MCUControllerSetup method registerTriggerCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerTriggerCommands() {
// Assignments to the main device
final MCUControlSurface surface = this.getSurface();
// Footswitches
this.addTriggerCommand(COMMAND_FOOTSWITCH1, MCUControlSurface.MCU_USER_A, new AssignableCommand(0, this.model, surface));
this.addTriggerCommand(COMMAND_FOOTSWITCH2, MCUControlSurface.MCU_USER_B, new AssignableCommand(1, this.model, surface));
// Navigation
this.addTriggerCommand(Commands.COMMAND_REWIND, MCUControlSurface.MCU_REWIND, new WindCommand<>(this.model, surface, false));
this.addTriggerCommand(Commands.COMMAND_FORWARD, MCUControlSurface.MCU_FORWARD, new WindCommand<>(this.model, surface, true));
this.addTriggerCommand(Commands.COMMAND_LOOP, MCUControlSurface.MCU_REPEAT, new ToggleLoopCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_STOP, MCUControlSurface.MCU_STOP, new StopCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_PLAY, MCUControlSurface.MCU_PLAY, new PlayCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_RECORD, MCUControlSurface.MCU_RECORD, new MCURecordCommand(this.model, surface));
this.addTriggerCommand(COMMAND_SCRUB, MCUControlSurface.MCU_SCRUB, new ScrubCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_LEFT, MCUControlSurface.MCU_ARROW_LEFT, new CursorCommand(Direction.LEFT, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_RIGHT, MCUControlSurface.MCU_ARROW_RIGHT, new CursorCommand(Direction.RIGHT, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_UP, MCUControlSurface.MCU_ARROW_UP, new CursorCommand(Direction.UP, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ARROW_DOWN, MCUControlSurface.MCU_ARROW_DOWN, new CursorCommand(Direction.DOWN, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_ZOOM, MCUControlSurface.MCU_ZOOM, new ZoomCommand(this.model, surface));
// Display Mode
this.addTriggerCommand(COMMAND_TOGGLE_DISPLAY, MCUControlSurface.MCU_NAME_VALUE, new ToggleDisplayCommand(this.model, surface));
this.addTriggerCommand(COMMAND_TEMPO_TICKS, MCUControlSurface.MCU_SMPTE_BEATS, new TempoTicksCommand(this.model, surface));
// Functions
this.addTriggerCommand(Commands.COMMAND_SHIFT, MCUControlSurface.MCU_SHIFT, new ShiftCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_SELECT, MCUControlSurface.MCU_OPTION, new NopCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_PUNCH_IN, MCUControlSurface.MCU_F6, new PunchInCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_PUNCH_OUT, MCUControlSurface.MCU_F7, new PunchOutCommand<>(this.model, surface));
this.addTriggerCommand(COMMAND_F1, MCUControlSurface.MCU_F1, new AssignableCommand(2, this.model, surface));
this.addTriggerCommand(COMMAND_F2, MCUControlSurface.MCU_F2, new AssignableCommand(3, this.model, surface));
this.addTriggerCommand(COMMAND_F3, MCUControlSurface.MCU_F3, new AssignableCommand(4, this.model, surface));
this.addTriggerCommand(COMMAND_F4, MCUControlSurface.MCU_F4, new AssignableCommand(5, this.model, surface));
this.addTriggerCommand(COMMAND_F5, MCUControlSurface.MCU_F5, new AssignableCommand(6, this.model, surface));
// Assignment
this.addTriggerCommand(Commands.COMMAND_TRACK, MCUControlSurface.MCU_MODE_IO, new TracksCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_PAN_SEND, MCUControlSurface.MCU_MODE_PAN, new ModeSelectCommand<>(Modes.MODE_PAN, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_SENDS, MCUControlSurface.MCU_MODE_SENDS, new SendSelectCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_DEVICE, MCUControlSurface.MCU_MODE_PLUGIN, new DevicesCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_MOVE_TRACK_LEFT, MCUControlSurface.MCU_MODE_EQ, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, true, true));
this.addTriggerCommand(Commands.COMMAND_MOVE_TRACK_RIGHT, MCUControlSurface.MCU_MODE_DYN, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, true, false));
// Automation
this.addTriggerCommand(Commands.COMMAND_AUTOMATION_READ, MCUControlSurface.MCU_READ, new AutomationCommand(0, this.model, surface));
final AutomationCommand writeCommand = new AutomationCommand(1, this.model, surface);
this.addTriggerCommand(Commands.COMMAND_AUTOMATION_WRITE, MCUControlSurface.MCU_WRITE, writeCommand);
this.addTriggerCommand(Commands.COMMAND_AUTOMATION_WRITE, MCUControlSurface.MCU_GROUP, writeCommand);
this.addTriggerCommand(Commands.COMMAND_AUTOMATION_TRIM, MCUControlSurface.MCU_TRIM, new AutomationCommand(2, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_AUTOMATION_TOUCH, MCUControlSurface.MCU_TOUCH, new AutomationCommand(3, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_AUTOMATION_LATCH, MCUControlSurface.MCU_LATCH, new AutomationCommand(4, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_UNDO, MCUControlSurface.MCU_UNDO, new UndoCommand<>(this.model, surface));
// Panes
this.addTriggerCommand(COMMAND_NOTE_EDITOR, MCUControlSurface.MCU_MIDI_TRACKS, new PaneCommand<>(PaneCommand.Panels.NOTE, this.model, surface));
this.addTriggerCommand(COMMAND_AUTOMATION_EDITOR, MCUControlSurface.MCU_INPUTS, new PaneCommand<>(PaneCommand.Panels.AUTOMATION, this.model, surface));
this.addTriggerCommand(COMMAND_TOGGLE_DEVICE, MCUControlSurface.MCU_AUDIO_TRACKS, new PaneCommand<>(PaneCommand.Panels.DEVICE, this.model, surface));
this.addTriggerCommand(COMMAND_MIXER, MCUControlSurface.MCU_AUDIO_INSTR, new PaneCommand<>(PaneCommand.Panels.MIXER, this.model, surface));
// Layouts
this.addTriggerCommand(COMMAND_LAYOUT_ARRANGE, MCUControlSurface.MCU_AUX, new LayoutCommand<>(IApplication.PANEL_LAYOUT_ARRANGE, this.model, surface));
this.addTriggerCommand(COMMAND_LAYOUT_MIX, MCUControlSurface.MCU_BUSSES, new LayoutCommand<>(IApplication.PANEL_LAYOUT_MIX, this.model, surface));
this.addTriggerCommand(COMMAND_LAYOUT_EDIT, MCUControlSurface.MCU_OUTPUTS, new LayoutCommand<>(IApplication.PANEL_LAYOUT_EDIT, this.model, surface));
// Utilities
this.addTriggerCommand(Commands.COMMAND_BROWSE, MCUControlSurface.MCU_USER, new BrowserCommand<>(Modes.MODE_BROWSER, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_METRONOME, MCUControlSurface.MCU_CLICK, new MetronomeCommand<>(this.model, surface));
this.addTriggerCommand(COMMAND_GROOVE, MCUControlSurface.MCU_SOLO, new GrooveCommand(this.model, surface));
this.addTriggerCommand(COMMAND_OVERDUB, MCUControlSurface.MCU_REPLACE, new OverdubCommand(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_TAP_TEMPO, MCUControlSurface.MCU_NUDGE, new TapTempoCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_DUPLICATE, MCUControlSurface.MCU_DROP, new DuplicateCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_DEVICE_ON_OFF, MCUControlSurface.MCU_F8, new DeviceOnOffCommand<>(this.model, surface));
// Currently not used but prevent error in console
this.addTriggerCommand(COMMAND_CONTROL, MCUControlSurface.MCU_CONTROL, new NopCommand<>(this.model, surface));
this.addTriggerCommand(COMMAND_ALT, MCUControlSurface.MCU_ALT, new NopCommand<>(this.model, surface));
// Fader Controls
this.addTriggerCommand(COMMAND_FLIP, MCUControlSurface.MCU_FLIP, new ToggleTrackBanksCommand<>(this.model, surface));
this.addTriggerCommand(COMMAND_CANCEL, MCUControlSurface.MCU_CANCEL, new KeyCommand(Key.ESCAPE, this.model, surface));
this.addTriggerCommand(COMMAND_ENTER, MCUControlSurface.MCU_ENTER, new KeyCommand(Key.ENTER, this.model, surface));
this.addTriggerCommand(Commands.COMMAND_MOVE_BANK_LEFT, MCUControlSurface.MCU_BANK_LEFT, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, false, true));
this.addTriggerCommand(Commands.COMMAND_MOVE_BANK_RIGHT, MCUControlSurface.MCU_BANK_RIGHT, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, false, false));
this.addTriggerCommand(Commands.COMMAND_MOVE_TRACK_LEFT, MCUControlSurface.MCU_TRACK_LEFT, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, true, true));
this.addTriggerCommand(Commands.COMMAND_MOVE_TRACK_RIGHT, MCUControlSurface.MCU_TRACK_RIGHT, new MoveTrackBankCommand<>(this.model, surface, Modes.MODE_DEVICE_PARAMS, true, false));
// Additional commands for footcontrollers
final ViewManager viewManager = surface.getViewManager();
viewManager.registerTriggerCommand(Commands.COMMAND_NEW, new NewCommand<>(this.model, surface));
viewManager.registerTriggerCommand(Commands.COMMAND_TAP_TEMPO, new TapTempoCommand<>(this.model, surface));
// Only MCU
this.addTriggerCommand(Commands.COMMAND_SAVE, MCUControlSurface.MCU_SAVE, new SaveCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_MARKER, MCUControlSurface.MCU_MARKER, new MarkerCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_TOGGLE_VU, MCUControlSurface.MCU_EDIT, new ToggleVUCommand<>(this.model, surface));
this.addTriggerCommand(Commands.COMMAND_MASTERTRACK, MCUControlSurface.MCU_FADER_MASTER, new SelectCommand(8, this.model, surface));
this.registerTriggerCommandsToAllDevices();
}
Aggregations