use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface in project DrivenByMoss by git-moss.
the class Kontrol1ControllerSetup method createViews.
/**
* {@inheritDoc}
*/
@Override
protected void createViews() {
final Kontrol1ControlSurface surface = this.getSurface();
final ViewManager viewManager = surface.getViewManager();
viewManager.register(Views.CONTROL, new ControlView(surface, this.model));
}
use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface in project DrivenByMoss by git-moss.
the class Kontrol1ControllerSetup method handleTrackChange.
/**
* Handle a track selection change.
*
* @param isSelected Has the track been selected?
*/
private void handleTrackChange(final boolean isSelected) {
if (!isSelected)
return;
this.host.scheduleTask(() -> {
final Kontrol1ControlSurface surface = this.getSurface();
final IView activeView = surface.getViewManager().getActive();
if (activeView != null) {
activeView.updateNoteMapping();
activeView.drawGrid();
}
if (this.model.canSelectedTrackHoldNotes()) {
final IDrumDevice primary = this.model.getDrumDevice();
if (primary.hasDrumPads())
primary.getDrumPadBank().scrollTo(0);
}
}, 100);
}
use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface in project DrivenByMoss by git-moss.
the class Kontrol1ControllerSetup method layoutControls.
/**
* {@inheritDoc}
*/
@Override
protected void layoutControls() {
final Kontrol1ControlSurface surface = this.getSurface();
surface.getButton(ButtonID.PLAY).setBounds(7.25, 135.25, 42.25, 23.5);
surface.getButton(ButtonID.RECORD).setBounds(68.0, 135.25, 42.25, 23.5);
surface.getButton(ButtonID.STOP).setBounds(128.75, 135.25, 42.25, 23.5);
surface.getButton(ButtonID.REWIND).setBounds(68.0, 100.75, 42.25, 23.5);
surface.getButton(ButtonID.FORWARD).setBounds(128.75, 100.75, 42.25, 23.5);
surface.getButton(ButtonID.LOOP).setBounds(7.25, 100.75, 42.25, 23.5);
surface.getButton(ButtonID.METRONOME).setBounds(128.75, 31.5, 42.25, 23.5);
surface.getButton(ButtonID.SHIFT).setBounds(7.25, 31.5, 42.25, 23.5);
surface.getButton(ButtonID.SCALES).setBounds(68.0, 31.5, 42.25, 23.5);
surface.getButton(ButtonID.PAGE_LEFT).setBounds(182.25, 65.5, 19.25, 23.5);
surface.getButton(ButtonID.PAGE_RIGHT).setBounds(209.5, 65.5, 19.25, 23.5);
surface.getButton(ButtonID.MUTE).setBounds(639.0, 105.25, 42.25, 23.5);
surface.getButton(ButtonID.SOLO).setBounds(747.5, 105.25, 42.25, 23.5);
surface.getButton(ButtonID.ARROW_UP).setBounds(693.25, 105.25, 42.25, 23.5);
surface.getButton(ButtonID.ARROW_DOWN).setBounds(693.25, 133.25, 42.25, 23.5);
surface.getButton(ButtonID.ARROW_LEFT).setBounds(639.0, 133.25, 42.25, 23.5);
surface.getButton(ButtonID.ARROW_RIGHT).setBounds(747.5, 133.25, 42.25, 23.5);
surface.getButton(ButtonID.BROWSE).setBounds(639.0, 46.75, 42.25, 23.5);
surface.getButton(ButtonID.MASTERTRACK).setBounds(686.25, 24.75, 49.5, 21.5);
surface.getContinuous(ContinuousID.MASTER_KNOB).setBounds(693.25, 44.75, 43.0, 53.75);
surface.getContinuous(ContinuousID.KNOB1).setBounds(241.0, 59.5, 35.0, 30.0);
surface.getContinuous(ContinuousID.KNOB2).setBounds(288.25, 59.5, 35.0, 30.0);
surface.getContinuous(ContinuousID.KNOB3).setBounds(335.5, 59.5, 35.0, 30.0);
surface.getContinuous(ContinuousID.KNOB4).setBounds(382.75, 59.5, 35.0, 30.0);
surface.getContinuous(ContinuousID.KNOB5).setBounds(430.0, 59.5, 35.0, 30.0);
surface.getContinuous(ContinuousID.KNOB6).setBounds(477.25, 59.5, 35.0, 30.0);
surface.getContinuous(ContinuousID.KNOB7).setBounds(524.5, 59.5, 35.0, 30.0);
surface.getContinuous(ContinuousID.KNOB8).setBounds(571.75, 59.5, 35.0, 30.0);
surface.getLight(OutputID.LIGHT_GUIDE1).setBounds(203.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE2).setBounds(225.75, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE3).setBounds(244.0, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE4).setBounds(263.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE5).setBounds(285.5, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE6).setBounds(311.5, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE7).setBounds(336.0, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE8).setBounds(355.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE9).setBounds(376.5, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE10).setBounds(394.0, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE11).setBounds(413.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE12).setBounds(436.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE13).setBounds(463.0, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE14).setBounds(487.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE15).setBounds(505.75, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE16).setBounds(522.75, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE17).setBounds(547.0, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE18).setBounds(573.0, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE19).setBounds(596.0, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE20).setBounds(617.5, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE21).setBounds(634.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE22).setBounds(653.5, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE23).setBounds(671.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE24).setBounds(696.25, 172.5, 15.5, 29.5);
surface.getLight(OutputID.LIGHT_GUIDE25).setBounds(726.75, 172.5, 15.5, 29.5);
surface.getTextDisplay().getHardwareDisplay().setBounds(190.75, 100.25, 422.75, 33.5);
surface.getContinuous(ContinuousID.PITCHBEND_WHEEL).setBounds(45.0, 219.5, 37.75, 68.5);
surface.getContinuous(ContinuousID.MODULATION_WHEEL).setBounds(96.0, 219.5, 37.75, 68.5);
surface.getPianoKeyboard().setBounds(196.5, 211.0, 558.75, 88.75);
}
use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface in project DrivenByMoss by git-moss.
the class Kontrol1ControllerSetup method createSurface.
/**
* {@inheritDoc}
*/
@Override
protected void createSurface() {
final Kontrol1UsbDevice usbDevice = new Kontrol1UsbDevice(this.modelIndex, this.host);
usbDevice.init();
final IMidiAccess midiAccess = this.factory.createMidiAccess();
final IMidiInput input = midiAccess.createInput("Komplete Kontrol 1", "80????", /* Note off */
"90????", /* Note on */
"B040??", "B001??", /* Sustain pedal + Modulation */
"D0????", /* Channel After-touch */
"E0????");
final Kontrol1ControlSurface surface = new Kontrol1ControlSurface(this.host, this.colorManager, this.configuration, input, usbDevice);
usbDevice.setCallback(surface);
this.surfaces.add(surface);
final Kontrol1Display display = new Kontrol1Display(this.host, this.valueChanger.getUpperBound(), this.configuration, usbDevice);
surface.addTextDisplay(display);
surface.getModeManager().setDefaultID(Modes.TRACK);
}
use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1ControlSurface in project DrivenByMoss by git-moss.
the class Kontrol1ControllerSetup method createModes.
/**
* {@inheritDoc}
*/
@Override
protected void createModes() {
final Kontrol1ControlSurface surface = this.getSurface();
final ModeManager modeManager = surface.getModeManager();
modeManager.register(Modes.TRACK, new TrackMode(surface, this.model));
modeManager.register(Modes.VOLUME, new VolumeMode(surface, this.model));
modeManager.register(Modes.DEVICE_PARAMS, new ParamsMode(surface, this.model));
modeManager.register(Modes.BROWSER, new BrowseMode(surface, this.model));
modeManager.register(Modes.SCALES, new ScaleMode(surface, this.model));
}
Aggregations