use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class SessionMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Display d = this.surface.getDisplay();
final ISceneBank sceneBank = this.model.getSceneBank();
for (int i = 0; i < 8; i++) {
final IScene scene = sceneBank.getScene(i);
final String name = StringUtils.fixASCII(scene.getName());
d.setCell(2, i, name.isEmpty() ? "Scene " + (i + 1) : name);
}
d.clearRow(0).done(0).done(2);
}
use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IChannelBank currentTrackBank = this.model.getCurrentTrackBank();
final ITrack t = currentTrackBank.getSelectedTrack();
final Display d = this.surface.getDisplay();
if (t == null) {
d.setRow(0, " Please select a track... ").clearRow(2).done(2);
return;
}
d.setCell(0, 0, "Volume").setCell(2, 0, t.getVolumeStr(8)).setCell(0, 1, "Pan").setCell(2, 1, t.getPanStr(8));
int sendStart = 2;
int sendCount = 6;
if (this.surface.getConfiguration().isDisplayCrossfader()) {
sendStart = 3;
sendCount = 5;
final String crossfadeMode = t.getCrossfadeMode();
d.setCell(0, 2, "Crossfdr").setCell(2, 2, "A".equals(crossfadeMode) ? "A" : "B".equals(crossfadeMode) ? " B" : " <> ");
}
final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
int pos;
if (fxTrackBank != null) {
final boolean isFX = this.model.isEffectTrackBankActive();
for (int i = 0; i < sendCount; i++) {
final ITrack fxTrack = fxTrackBank.getTrack(i);
final boolean isEmpty = isFX || !fxTrack.doesExist();
pos = sendStart + i;
d.setCell(0, pos, isEmpty ? "" : fxTrack.getName()).setCell(2, pos, isEmpty ? "" : t.getSend(i).getDisplayedValue(8));
}
if (isFX)
d.setCell(0, 7, t.getName());
} else {
for (int i = 0; i < sendCount; i++) {
pos = sendStart + i;
final ISend send = t.getSend(i);
d.setCell(0, pos, send.getName(8)).setCell(2, pos, send.getDisplayedValue(8));
}
}
d.done(0).done(2);
}
use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class DeviceParamsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Display d = this.surface.getDisplay().clearRow(0).clearRow(2);
final ICursorDevice cd = this.model.getCursorDevice();
if (cd.hasSelectedDevice()) {
for (int i = 0; i < 8; i++) {
final IParameter param = cd.getFXParam(i);
d.setCell(0, i, param.doesExist() ? StringUtils.shortenAndFixASCII(param.getName(), 8) : "").setCell(2, i, param.getDisplayedValue(8));
}
} else
d.setRow(0, " Please select a device... ");
d.done(0).done(2);
}
use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class DevicePresetsMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Display d = this.surface.getDisplay();
if (!this.model.hasSelectedDevice()) {
d.clearRow(2).done(2).setRow(0, " Please select a device... ");
return;
}
final IBrowser browser = this.model.getBrowser();
if (!browser.isActive()) {
d.setRow(0, " No active Browsing Session. ").setRow(2, " Press Browse again... ");
return;
}
d.clear();
String selectedResult;
switch(this.selectionMode) {
case DevicePresetsMode.SELECTION_OFF:
selectedResult = browser.getSelectedResult();
d.setBlock(0, 0, "Preset:").setBlock(2, 0, selectedResult == null ? "None" : selectedResult);
for (int i = 0; i < 6; i++) {
final IBrowserColumn column = browser.getFilterColumn(i);
d.setCell(0, 2 + i, StringUtils.shortenAndFixASCII(column.getName() + ":", 8)).setCell(2, 2 + i, column.doesCursorExist() ? column.getCursorName() : "");
}
break;
case DevicePresetsMode.SELECTION_PRESET:
final IBrowserColumnItem[] results = browser.getResultColumnItems();
for (int i = 0; i < 16; i++) d.setCell(i % 2 * 2, i / 2, (results[i].isSelected() ? SLDisplay.RIGHT_ARROW : " ") + results[i].getName());
break;
case DevicePresetsMode.SELECTION_FILTER:
final IBrowserColumnItem[] items = browser.getFilterColumn(this.filterColumn).getItems();
for (int i = 0; i < 16; i++) {
final String name = StringUtils.fixASCII(items[i].getName());
String text = (items[i].isSelected() ? SLDisplay.RIGHT_ARROW : " ") + name + " ";
if (!name.isEmpty()) {
final String hitStr = "(" + items[i].getHitCount() + ")";
text = text.substring(0, 17 - hitStr.length()) + hitStr;
}
d.setCell(i % 2 * 2, i / 2, text);
}
break;
}
d.allDone();
}
use of de.mossgrabers.framework.controller.display.Display in project DrivenByMoss by git-moss.
the class FrameMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Display d = this.surface.getDisplay();
d.clear().setBlock(0, 0, "Layouts:").setCell(0, 3, "Panels:");
for (int i = 0; i < COMMANDS.length; i++) d.setCell(2, i, COMMANDS[i]);
d.done(0).done(2);
}
Aggregations