use of de.mossgrabers.apc.controller.APCControlSurface 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.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.
the class APCControllerSetup method updateIndication.
private void updateIndication(final Integer mode) {
final ITrackBank tb = this.model.getTrackBank();
final IChannelBank tbe = this.model.getEffectTrackBank();
final APCControlSurface surface = this.getSurface();
final boolean isSession = surface.getViewManager().isActiveView(Views.VIEW_SESSION);
final boolean isEffect = this.model.isEffectTrackBankActive();
final boolean isPan = mode == Modes.MODE_PAN;
tb.setIndication(!isEffect && isSession);
tbe.setIndication(isEffect && isSession);
final ICursorDevice cursorDevice = this.model.getCursorDevice();
for (int i = 0; i < 8; i++) {
final ITrack track = tb.getTrack(i);
track.setVolumeIndication(!isEffect);
track.setPanIndication(!isEffect && isPan);
for (int j = 0; j < 8; j++) track.getSend(j).setIndication(!isEffect && (mode == Modes.MODE_SEND1 && j == 0 || mode == Modes.MODE_SEND2 && j == 1 || mode == Modes.MODE_SEND3 && j == 2 || mode == Modes.MODE_SEND4 && j == 3 || mode == Modes.MODE_SEND5 && j == 4 || mode == Modes.MODE_SEND6 && j == 5 || mode == Modes.MODE_SEND7 && j == 6 || mode == Modes.MODE_SEND8 && j == 7));
final ITrack fxTrack = tbe.getTrack(i);
fxTrack.setVolumeIndication(isEffect);
fxTrack.setPanIndication(isEffect && isPan);
cursorDevice.indicateParameter(i, true);
}
}
use of de.mossgrabers.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.
the class APCControllerSetup method createViews.
/**
* {@inheritDoc}
*/
@Override
protected void createViews() {
final APCControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
viewManager.registerView(Views.VIEW_SESSION, new SessionView(surface, this.model));
viewManager.registerView(Views.VIEW_SEQUENCER, new SequencerView(surface, this.model));
viewManager.registerView(Views.VIEW_DRUM, new DrumView(surface, this.model));
viewManager.registerView(Views.VIEW_RAINDROPS, new RaindropsView(surface, this.model));
viewManager.registerView(Views.VIEW_SHIFT, new ShiftView(surface, this.model));
}
use of de.mossgrabers.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.
the class APCControllerSetup method createObservers.
/**
* {@inheritDoc}
*/
@Override
protected void createObservers() {
final APCControlSurface surface = this.getSurface();
surface.getViewManager().addViewChangeListener((previousViewId, activeViewId) -> this.updateMode(null));
surface.getModeManager().addModeListener((previousModeId, activeModeId) -> this.updateMode(activeModeId));
this.createScaleObservers(this.configuration);
}
use of de.mossgrabers.apc.controller.APCControlSurface in project DrivenByMoss by git-moss.
the class APCControllerSetup method startup.
/**
* {@inheritDoc}
*/
@Override
public void startup() {
final APCControlSurface surface = this.getSurface();
surface.getModeManager().setActiveMode(Modes.MODE_PAN);
surface.getViewManager().setActiveView(Views.VIEW_PLAY);
}
Aggregations