use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class DeviceBrowserMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IBrowser browser = this.model.getBrowser();
final Display d = this.surface.getDisplay();
final boolean isPresetSession = browser.isPresetContentType();
final ICursorDevice cd = this.model.getCursorDevice();
if (isPresetSession && !(browser.isActive() && cd.hasSelectedDevice())) {
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 IBrowserColumn column = this.getFilterColumn(i);
final String value = column != null && column.doesCursorExist() ? column.getCursorName().equals(column.getWildcard()) ? "-" : column.getCursorName() : "";
final String name = column == null ? "" : StringUtils.shortenAndFixASCII(column.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;
}
d.allDone();
}
use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.drawDisplay2();
final Display d = this.surface.getDisplay().clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.hasSelectedDevice()) {
d.notify("Please select a Device...", true, false);
return;
}
// Row 1 & 2
final int extenderOffset = this.surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final IParameter param = cd.getFXParam(extenderOffset + i);
d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName()) : "").setCell(1, i, param.getDisplayedValue(8));
}
d.allDone();
}
use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class AbstractTrackMode method drawTrackHeader.
protected boolean drawTrackHeader() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final Display d = this.surface.getDisplay().clear();
// Format track names
final int extenderOffset = this.surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(extenderOffset + i);
final String name = t.getName();
d.setCell(0, i, StringUtils.shortenAndFixASCII(name, 6));
}
d.done(0);
return true;
}
use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class PanMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
if (!this.surface.getConfiguration().hasDisplay1())
return;
this.drawDisplay2();
if (!this.drawTrackHeader())
return;
final Display d = this.surface.getDisplay();
final IChannelBank tb = this.model.getCurrentTrackBank();
final int extenderOffset = this.surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(extenderOffset + i);
d.setCell(1, i, t.getPanStr(6));
}
d.done(1);
}
use of de.mossgrabers.framework.controller.display.Display 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 Display d = this.surface.getDisplay();
final IChannelBank tb = this.model.getCurrentTrackBank();
final int extenderOffset = this.surface.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(extenderOffset + i);
d.setCell(1, i, t.getVolumeStr(6));
}
d.done(1);
}
Aggregations