use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.drawDisplay2();
final ITextDisplay d = this.surface.getTextDisplay().clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.doesExist()) {
d.notify("Please select a device...");
return;
}
// Row 1 & 2
final int extenderOffset = this.surface.getExtenderOffset();
final IParameterBank parameterBank = cd.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(extenderOffset + i);
d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(6), 6) : "").setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(6), 6));
}
d.allDone();
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
if (!this.surface.getConfiguration().hasDisplay1())
return;
this.drawDisplay2();
if (!this.drawTrackHeader())
return;
final ITextDisplay d = this.surface.getTextDisplay().clear();
final Optional<ITrack> selectedTrack = this.getSelectedTrack();
if (selectedTrack.isEmpty()) {
d.notify("Please select a track...");
return;
}
final boolean displayTrackNames = this.surface.getConfiguration().isDisplayTrackNames();
if (!displayTrackNames) {
d.setCell(0, 0, "Volume");
d.setCell(0, 1, "Pan");
}
final ITrack t = selectedTrack.get();
d.setCell(1, 0, t.getVolumeStr(6));
d.setCell(1, 1, t.getPanStr(6));
final int sendStart = 2;
final int sendCount = 6;
final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
final ISendBank sendBank = t.getSendBank();
for (int i = 0; i < sendCount; i++) {
final int pos = sendStart + i;
if (!isEffectTrackBankActive && i < sendBank.getItemCount()) {
final ISend send = sendBank.getItem(i);
if (send.doesExist()) {
if (!displayTrackNames)
d.setCell(0, pos, StringUtils.fixASCII(send.getName()));
d.setCell(1, pos, send.getDisplayedValue(6));
}
}
}
if (!displayTrackNames)
d.done(0);
d.done(1);
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class SelectCommand method handleButtonCombinations.
private boolean handleButtonCombinations(final ButtonEvent event) {
// Select Send channels if Send button is pressed
if (this.surface.isPressed(ButtonID.SENDS)) {
if (event != ButtonEvent.DOWN)
return true;
final ITextDisplay display = this.surface.getTextDisplay();
final ITrackBank effectTrackBank = this.model.getEffectTrackBank();
if (effectTrackBank != null && effectTrackBank.getItem(this.channel).doesExist()) {
this.surface.getModeManager().setActive(Modes.get(Modes.SEND1, this.index));
display.notify("Send channel " + (this.channel + 1) + " selected.");
} else
display.notify("Send channel " + (this.channel + 1) + " does not exist.");
this.surface.setTriggerConsumed(ButtonID.SENDS);
return true;
}
// Execute stop if Select is pressed
if (this.surface.isSelectPressed()) {
if (event == ButtonEvent.DOWN)
this.getTrackBank().getItem(this.channel).stop();
return true;
}
if (this.surface.getConfiguration().hasOnly1Fader()) {
if (event != ButtonEvent.DOWN)
return true;
final ModeManager modeManager = this.surface.getModeManager();
// Select marker if marker mode is active
if (modeManager.isActive(Modes.MARKERS)) {
this.model.getMarkerBank().getItem(this.channel).select();
return true;
}
// Select parameter if device mode is active
if (modeManager.isActive(Modes.DEVICE_PARAMS)) {
final ICursorDevice cursorDevice = this.model.getCursorDevice();
if (cursorDevice.doesExist())
cursorDevice.getParameterBank().getItem(this.channel).select();
return true;
}
}
return false;
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class VolumeMode method drawTrackHeader.
/**
* {@inheritDoc}
*/
@Override
protected boolean drawTrackHeader() {
if (!super.drawTrackHeader())
return false;
if (this.surface.getConfiguration().isDisplayTrackNames())
return true;
final ITrackBank tb = this.getTrackBank();
final ITextDisplay d = this.surface.getTextDisplay();
final int extenderOffset = this.getExtenderOffset();
for (int i = 0; i < 8; i++) {
if (tb.getItem(extenderOffset + i).doesExist())
d.setCell(0, i, "Volume");
else
d.clearCell(0, i);
}
d.done(0);
return true;
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class FunctionMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clearRow(0).clearRow(1);
d.setBlock(0, 0, "Functions:");
d.setCell(1, 0, " Undo").setCell(1, 1, " Redo").setCell(1, 2, " Delete").setCell(1, 3, " Double");
d.setCell(1, 4, " New").setCell(1, 5, " Window ").setCell(1, 6, "Metronom").setCell(1, 7, "TapTempo");
d.done(0).done(1);
}
Aggregations