use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class VolumeMode 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();
final ITrackBank tb = this.getTrackBank();
final int extenderOffset = this.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(extenderOffset + i);
d.setCell(1, i, t.getVolumeStr(6));
}
d.done(1);
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class TempoMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clear();
final ITransport transport = this.model.getTransport();
final double tempo = transport.getTempo();
d.setCell(0, 0, "Tempo:").setBlock(0, 1, String.format("> %.02f", Double.valueOf(tempo)));
d.setBlock(0, 2, "Time:").setBlock(0, 3, " " + transport.getPositionText());
d.setBlock(1, 2, "Position:").setBlock(1, 3, " " + transport.getBeatText());
d.allDone();
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class LaunchkeyMk3SendMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay();
final ICursorTrack cursorTrack = this.model.getCursorTrack();
final String trackText = cursorTrack.doesExist() ? String.format("%d: %s", Integer.valueOf(cursorTrack.getPosition() + 1), cursorTrack.getName()) : "No sel. track";
final ITrackBank tb = this.model.getCurrentTrackBank();
if (this.areKnobs) {
String sendName = tb.getEditSendName(this.sendIndex);
sendName = StringUtils.optimizeName(sendName.isEmpty() ? "Send " + (this.sendIndex + 1) : sendName, 6);
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, sendName + this.formatPageRange(" %d - %d"));
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE + 1, 0, trackText);
}
final int row = this.areKnobs ? LaunchkeyMk3Display.SCREEN_ROW_POTS : LaunchkeyMk3Display.SCREEN_ROW_FADERS;
// Format track names
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
final ISend s = t.getSendBank().getItem(this.sendIndex);
final boolean exists = s.doesExist();
final int offset = i * 2;
d.setCell(row + offset, 0, exists ? String.format("%d: %s", Integer.valueOf(s.getPosition() + 1), s.getName()) : "No send");
d.setCell(row + offset + 1, 0, exists ? "S-Vol: " + s.getDisplayedValue() : "");
}
// Add master fader
if (!this.areKnobs) {
final IMasterTrack masterTrack = this.model.getMasterTrack();
d.setCell(row + 16, 0, "Master");
d.setCell(row + 16 + 1, 0, "Vol: " + masterTrack.getVolumeStr());
}
d.allDone();
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class BrowseMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IBrowser browser = this.model.getBrowser();
final ITextDisplay d = this.surface.getTextDisplay();
final boolean isPresetSession = browser.isPresetContentType();
final ICursorDevice cd = this.model.getCursorDevice();
if (isPresetSession && !(browser.isActive() && cd.doesExist())) {
d.notify("No active Browsing Session. Select device and press Browser...");
return;
}
d.clear();
for (int i = 0; i < 7; i++) {
final Optional<IBrowserColumn> column = this.getFilterColumn(i);
String value = "";
String name = "";
if (column.isPresent()) {
final IBrowserColumn browserColumn = column.get();
if (browserColumn.doesCursorExist())
value = browserColumn.getCursorName().equals(browserColumn.getWildcard()) ? "-" : browserColumn.getCursorName();
name = StringUtils.shortenAndFixASCII(browserColumn.getName(), 6);
}
if (i == this.getSelectedParameter())
name = ">" + name;
d.setCell(0, i, name).setCell(1, i, value);
}
final String selectedResult = browser.getSelectedResult();
String selectedContentType = browser.getSelectedContentType();
if (this.getSelectedParameter() == 7)
selectedContentType = ">" + selectedContentType;
d.setCell(0, 7, selectedContentType).setCell(1, 7, selectedResult == null || selectedResult.length() == 0 ? "-" : selectedResult);
d.allDone();
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class MaschineParametersMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
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 IParameterBank parameterBank = cd.getParameterBank();
for (int i = 0; i < 8; i++) {
final IParameter param = parameterBank.getItem(i);
String name = param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 6) : "";
if (i == this.getSelectedParameter())
name = ">" + name;
d.setCell(0, i, name).setCell(1, i, StringUtils.shortenAndFixASCII(param.getDisplayedValue(8), 8));
}
d.allDone();
}
Aggregations