use of de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent in project DrivenByMoss by git-moss.
the class FireUserMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
final IParameterBank userBank = this.model.getUserParameterBank();
final int page = userBank.getScrollPosition() / userBank.getPageSize();
final String desc = "User Page: " + (page + 1);
String paramLine = "";
int value = -1;
final int touchedKnob = this.getTouchedKnob();
if (touchedKnob > -1) {
final IParameter p = userBank.getItem(touchedKnob);
paramLine = p.getName(5);
if (paramLine.isEmpty())
paramLine = "Not mapped";
else {
value = p.getValue();
paramLine += ": " + p.getDisplayedValue(6);
}
}
display.addElement(new TitleValueComponent(desc, paramLine, value, false));
display.send();
}
use of de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent in project DrivenByMoss by git-moss.
the class FireParameterMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IGraphicDisplay display = this.surface.getGraphicsDisplay();
String desc = "Select";
String paramLine = "a device";
int value = -1;
if (this.model.hasSelectedDevice()) {
paramLine = "";
final ICursorDevice cursorDevice = this.model.getCursorDevice();
final Optional<String> pageName = cursorDevice.getParameterPageBank().getSelectedItem();
desc = cursorDevice.getName(5) + ": " + (pageName.isPresent() ? StringUtils.optimizeName(pageName.get(), 5) : "None");
int touchedKnob = this.getTouchedKnob();
touchedKnob = this.surface.isPressed(ButtonID.ALT) ? 4 + touchedKnob : touchedKnob;
if (touchedKnob > -1) {
final IParameter p = this.bank.getItem(touchedKnob);
paramLine = p.getName(5);
if (!paramLine.isEmpty()) {
value = p.getValue();
paramLine += ": " + p.getDisplayedValue(6);
}
}
}
display.addElement(new TitleValueComponent(desc, paramLine, value, false));
display.send();
}
use of de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleValueComponent 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.controller.akai.fire.graphics.canvas.component.TitleValueComponent 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();
}
Aggregations