use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.
the class APCminiControllerSetup method registerTriggerCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerTriggerCommands() {
final APCminiControlSurface surface = this.getSurface();
this.addNoteCommand(Commands.COMMAND_SHIFT, APCminiControlSurface.APC_BUTTON_SHIFT, new ShiftCommand(this.model, surface));
for (int i = 0; i < 8; i++) {
this.addNoteCommand(Integer.valueOf(Commands.COMMAND_ROW_SELECT_1.intValue() + i), APCminiControlSurface.APC_BUTTON_TRACK_BUTTON1 + i, new TrackSelectCommand(i, this.model, surface));
this.addNoteCommand(Integer.valueOf(Commands.COMMAND_SCENE1.intValue() + i), APCminiControlSurface.APC_BUTTON_SCENE_BUTTON1 + i, new SceneCommand<>(7 - i, this.model, surface));
}
}
use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.
the class APCminiControllerSetup method createViews.
/**
* {@inheritDoc}
*/
@Override
protected void createViews() {
final APCminiControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
viewManager.registerView(Views.VIEW_SHIFT, new ShiftView(surface, this.model));
viewManager.registerView(Views.VIEW_BROWSER, new BrowserView(surface, this.model));
if (this.host.hasClips()) {
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));
}
}
use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.
the class APCminiControllerSetup method registerContinuousCommands.
/**
* {@inheritDoc}
*/
@Override
protected void registerContinuousCommands() {
final APCminiControlSurface surface = this.getSurface();
this.addContinuousCommand(Commands.CONT_COMMAND_MASTER_KNOB, APCminiControlSurface.APC_KNOB_MASTER_LEVEL, new MasterFaderAbsoluteCommand<>(this.model, surface));
for (int i = 0; i < 8; i++) {
final Integer knobCommand = Integer.valueOf(Commands.CONT_COMMAND_FADER1.intValue() + i);
this.addContinuousCommand(knobCommand, APCminiControlSurface.APC_KNOB_TRACK_LEVEL1 + i, new KnobRowModeCommand<>(i, this.model, surface));
}
}
use of de.mossgrabers.apcmini.controller.APCminiControlSurface in project DrivenByMoss by git-moss.
the class APCminiControllerSetup method handleTrackChange.
/**
* Handle a track selection change.
*
* @param index The index of the track
* @param isSelected Has the track been selected?
*/
private void handleTrackChange(final int index, final boolean isSelected) {
if (!isSelected)
return;
final APCminiControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
if (viewManager.isActiveView(Views.VIEW_PLAY))
viewManager.getActiveView().updateNoteMapping();
if (viewManager.isActiveView(Views.VIEW_PLAY))
viewManager.getActiveView().updateNoteMapping();
// Reset drum octave because the drum pad bank is also reset
this.scales.setDrumOctave(0);
if (viewManager.isActiveView(Views.VIEW_DRUM))
viewManager.getView(Views.VIEW_DRUM).updateNoteMapping();
}
Aggregations