use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display in project DrivenByMoss by git-moss.
the class ScaleMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
d.clear();
d.setCell(0, 0, "SCALE");
d.setCell(0, 1, "SCALE").setCell(1, 1, this.scales.getScale().getName().toUpperCase(Locale.US));
d.setCell(0, 2, "BASE").setCell(1, 2, Scales.BASES.get(this.scales.getScaleOffset()));
d.allDone();
}
use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display in project DrivenByMoss by git-moss.
the class VolumeMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
d.clear();
d.setCell(0, 0, this.model.isEffectTrackBankActive() ? "VOL-FX" : "VOLUME").setCell(1, 0, this.formatPageRange("%d - %d"));
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> selTrack = tb.getSelectedItem();
final int selIndex = selTrack.isEmpty() ? -1 : selTrack.get().getIndex();
for (int i = 0; i < 8; i++) {
final boolean isSel = i == selIndex;
final ITrack t = tb.getItem(i);
final String n = StringUtils.shortenAndFixASCII(t.getName(), isSel ? 7 : 8).toUpperCase(Locale.US);
d.setCell(0, 1 + i, isSel ? ">" + n : n).setCell(1, 1 + i, getSecondLineText(t));
d.setBar(1 + i, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB1, i)).isTouched() && t.doesExist(), t.getVolume());
}
d.allDone();
}
use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
final Optional<ITrack> t = currentTrackBank.getSelectedItem();
final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
d.clear();
if (t.isEmpty()) {
d.setCell(0, 3, " PLEASE").setCell(0, 4, "SELECT A").setCell(0, 5, "TRACK").allDone();
return;
}
final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
final ITrack track = t.get();
d.setCell(0, 0, (isEffectTrackBankActive ? "TR-FX " : "TRACK ") + (track.getPosition() + 1)).setCell(1, 0, StringUtils.shortenAndFixASCII(track.getName(), 8).toUpperCase(Locale.US));
d.setCell(0, 1, "VOLUME").setCell(1, 1, getSecondLineText(track)).setCell(0, 2, "PAN").setCell(1, 2, track.getPanStr(8));
d.setBar(1, this.surface.getContinuous(ContinuousID.KNOB1).isTouched(), track.getVolume());
d.setPanBar(2, this.surface.getContinuous(ContinuousID.KNOB2).isTouched(), track.getPan());
if (!isEffectTrackBankActive) {
final ISendBank sendBank = track.getSendBank();
for (int i = 0; i < 6; i++) {
final int pos = 3 + i;
final ISend sendData = sendBank.getItem(i);
d.setCell(0, pos, StringUtils.shortenAndFixASCII(sendData.getName(8), 8).toUpperCase(Locale.US)).setCell(1, pos, sendData.getDisplayedValue(8));
d.setBar(pos, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB3, i)).isTouched() && sendData.doesExist(), sendData.getValue());
}
}
d.allDone();
}
use of de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display 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.Kontrol1Display in project DrivenByMoss by git-moss.
the class ParamsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Kontrol1Display d = (Kontrol1Display) this.surface.getDisplay();
d.clear();
if (this.model.hasSelectedDevice()) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
d.setCell(0, 0, cursorDevice.getName(8).toUpperCase(Locale.US));
final Optional<String> selectedItem = cursorDevice.getParameterPageBank().getSelectedItem();
if (selectedItem.isPresent())
d.setCell(1, 0, selectedItem.get().toUpperCase(Locale.US));
for (int i = 0; i < 8; i++) {
final IParameter p = this.bank.getItem(i);
final String name = StringUtils.shortenAndFixASCII(p.getName(8), 8).toUpperCase(Locale.US);
if (!name.isEmpty())
d.setCell(0, 1 + i, name).setCell(1, 1 + i, checkForUpperCase(StringUtils.shortenAndFixASCII(p.getDisplayedValue(8), 8)));
d.setBar(1 + i, this.surface.getContinuous(ContinuousID.get(ContinuousID.KNOB1, i)).isTouched() && p.doesExist(), p.getValue());
}
} else
d.setCell(0, 3, " PLEASE").setCell(0, 4, "SELECT A").setCell(0, 5, "DEVICE").allDone();
d.allDone();
}
Aggregations