use of de.mossgrabers.framework.controller.display.IGraphicDisplay in project DrivenByMoss by git-moss.
the class FireLayerMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.updateMode();
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
String desc = "Select";
String label = "a drum pad";
int value = -1;
int vuLeft = -1;
int vuRight = -1;
boolean isPan = false;
final ISpecificDevice cd = this.model.getDrumDevice();
final Optional<ILayer> channelOptional = cd.getLayerBank().getSelectedItem();
if (channelOptional.isPresent()) {
final IChannel channel = channelOptional.get();
vuLeft = channel.getVuLeft();
vuRight = channel.getVuRight();
desc = channel.getPosition() + 1 + ": " + channel.getName(9);
final ISendBank sendBank = channel.getSendBank();
switch(this.selectedParameter) {
case VOLUME:
label = "Vol: " + channel.getVolumeStr();
value = channel.getVolume();
break;
case PAN:
label = "Pan: " + channel.getPanStr();
value = channel.getPan();
isPan = true;
break;
case SEND1:
case SEND2:
case SEND3:
case SEND4:
case SEND5:
case SEND6:
final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
label = getSendLabel(sendBank, sendIndex);
value = getSendValue(sendBank, sendIndex);
break;
default:
label = "Select a track";
break;
}
}
display.addElement(new TitleValueComponent(desc, label, value, vuLeft, vuRight, isPan));
display.send();
}
use of de.mossgrabers.framework.controller.display.IGraphicDisplay in project DrivenByMoss by git-moss.
the class FireTrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
this.updateMode();
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
String desc = "Select";
String label = "a track";
int value = -1;
int vuLeft = -1;
int vuRight = -1;
boolean isPan = false;
final Optional<ITrack> trackOptional = this.model.getCurrentTrackBank().getSelectedItem();
if (trackOptional.isPresent()) {
final ITrack track = trackOptional.get();
vuLeft = track.getVuLeft();
vuRight = track.getVuRight();
desc = track.getPosition() + 1 + ": " + track.getName(9);
final ISendBank sendBank = track.getSendBank();
switch(this.selectedParameter) {
case VOLUME:
label = "Vol: " + track.getVolumeStr();
value = track.getVolume();
break;
case PAN:
label = "Pan: " + track.getPanStr();
value = track.getPan();
isPan = true;
break;
case SEND1:
case SEND2:
case SEND3:
case SEND4:
case SEND5:
case SEND6:
final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
label = getSendLabel(sendBank, sendIndex);
value = getSendValue(sendBank, sendIndex);
break;
default:
// Not used
break;
}
}
display.addElement(new TitleValueComponent(desc, label, value, vuLeft, vuRight, isPan));
display.send();
}
use of de.mossgrabers.framework.controller.display.IGraphicDisplay in project DrivenByMoss by git-moss.
the class BrowserMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IBrowser browser = this.model.getBrowser();
if (!browser.isActive())
return;
final String[] rows = new String[3];
final boolean[] sels = new boolean[] { false, false, false };
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
final int idx = this.getTouchedKnob();
if (idx < 0) {
final String selectedResult = browser.getSelectedResult();
rows[0] = browser.getSelectedContentType().toUpperCase(Locale.US);
rows[1] = "Selection: ";
rows[2] = selectedResult == null || selectedResult.isBlank() ? "None" : selectedResult;
} else if (idx == 8) {
final IBrowserColumnItem[] results = browser.getResultColumnItems();
if (results[0].doesExist()) {
for (int item = 0; item < 3; item++) {
rows[item] = item < results.length ? results[item].getName() : "";
sels[item] = item < results.length && results[item].isSelected();
}
} else {
rows[0] = "No";
rows[1] = "results ";
rows[2] = "available...";
}
} else {
final IBrowserColumn filterColumn = browser.getFilterColumn(idx);
if (filterColumn.doesExist() && filterColumn.doesCursorExist()) {
final IBrowserColumnItem[] item = filterColumn.getItems();
for (int itemIndex = 0; itemIndex < 3; itemIndex++) {
final int pos = itemIndex;
String text = StringUtils.optimizeName(item[pos].getName(), 10);
if (!text.isEmpty())
text = text + " (" + item[pos].getHitCount() + ")";
rows[itemIndex] = text;
sels[itemIndex] = item[pos].isSelected();
}
} else {
rows[0] = "";
rows[1] = "";
rows[2] = "";
}
}
display.addListElement(rows, sels);
display.send();
}
Aggregations