use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class MaschineVolumeMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay();
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
String name = StringUtils.shortenAndFixASCII(t.getName(), 6);
if (t.isSelected())
name = ">" + name;
d.setCell(0, i, name);
if (this.displayVU && !this.isKnobTouched[i] && !(this.isKnobTouched[8] && t.isSelected())) {
final int steps = (int) Math.round(this.model.getValueChanger().toNormalizedValue(t.getVu()) * 6);
d.setCell(1, i, StringUtils.pad("", steps, '>'));
} else
d.setCell(1, i, t.getVolumeStr(6));
}
d.allDone();
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class PlayConfigurationMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clear();
final Scales scales = this.model.getScales();
d.setBlock(0, 0, this.mark("Scale", 0)).setBlock(1, 0, scales.getScale().getName());
d.setCell(0, 3, this.mark("Base", 3)).setCell(1, 3, Scales.BASES.get(scales.getScaleOffset()));
d.setBlock(0, 2, this.mark("Layout", 4)).setBlock(1, 2, StringUtils.optimizeName(scales.getScaleLayout().getName(), 12));
d.setCell(0, 6, this.mark("In-Key", 6)).setCell(1, 6, scales.isChromatic() ? "Off" : "On");
final int octave = scales.getOctave();
d.setCell(0, 7, this.mark("Octave", 7)).setCell(1, 7, (octave > 0 ? "+" : "") + Integer.toString(octave));
d.allDone();
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class BaseMode method drawDisplay2.
protected void drawDisplay2() {
if (!this.surface.getConfiguration().hasDisplay2())
return;
final ITrackBank tb = this.getTrackBank();
// Format track names
final ITextDisplay d2 = this.surface.getTextDisplay(1);
final int extenderOffset = this.getExtenderOffset();
final boolean isMainDevice = this.surface.isMainDevice();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(extenderOffset + i);
d2.setCell(0, i, StringUtils.shortenAndFixASCII(t.getName(), isMainDevice ? 6 : 7));
}
if (isMainDevice)
d2.setCell(0, 8, "Maste");
d2.done(0);
d2.clearRow(1);
if (isMainDevice) {
final IMasterTrack masterTrack = this.model.getMasterTrack();
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final ITrack selectedTrack;
if (masterTrack.isSelected())
selectedTrack = masterTrack;
else {
final Optional<ITrack> selectedItem = tb.getSelectedItem();
selectedTrack = selectedItem.isPresent() ? selectedItem.get() : EmptyTrack.INSTANCE;
}
d2.setBlock(1, 0, "Sel. track:").setBlock(1, 1, selectedTrack == null ? "None" : StringUtils.shortenAndFixASCII(selectedTrack.getName(), 11));
d2.setBlock(1, 2, "Sel. devce:").setBlock(1, 3, cursorDevice.doesExist() ? StringUtils.shortenAndFixASCII(cursorDevice.getName(), 11) : "None");
}
d2.done(1);
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class DeviceBrowserMode 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();
switch(this.selectionMode) {
case SELECTION_OFF:
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);
}
d.setCell(0, i, name).setCell(1, i, value);
}
final String selectedResult = browser.getSelectedResult();
d.setCell(0, 7, browser.getSelectedContentType()).setCell(1, 7, selectedResult == null || selectedResult.length() == 0 ? "-" : selectedResult);
break;
case SELECTION_PRESET:
final IBrowserColumnItem[] results = browser.getResultColumnItems();
for (int i = 0; i < browser.getNumFilterColumnEntries(); i++) {
if (i < results.length)
d.setBlock(i / 4, i % 4, (results[i].isSelected() ? ">" : " ") + StringUtils.fixASCII(results[i].getName()));
else
break;
}
break;
case SELECTION_FILTER:
final IBrowserColumnItem[] items = browser.getFilterColumn(this.filterColumn).getItems();
for (int i = 0; i < browser.getNumResults(); i++) d.setBlock(i / 4, i % 4, (items[i].isSelected() ? ">" : " ") + StringUtils.fixASCII(items[i].getName()));
break;
default:
// Not used
break;
}
d.allDone();
}
use of de.mossgrabers.framework.controller.display.ITextDisplay in project DrivenByMoss by git-moss.
the class MarkerMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay().clear();
final IMarkerBank markerBank = this.model.getMarkerBank();
final int extenderOffset = this.surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final IMarker marker = markerBank.getItem(extenderOffset + i);
if (!marker.doesExist())
continue;
final String name = StringUtils.shortenAndFixASCII(marker.getName(), 6);
d.setCell(0, i, name);
}
d.allDone();
}
Aggregations