use of de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay in project DrivenByMoss by git-moss.
the class SLMkIIIPanMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final SLMkIIIDisplay d = this.surface.getDisplay();
d.clear();
d.setCell(0, 8, "Pan");
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
if (t.doesExist())
d.setCell(0, i, "Pan").setCell(1, i, t.getPanStr(9));
this.setColumnColors(d, i, t, SLMkIIIColorManager.SLMKIII_AMBER);
}
final ITrack cursorTrack = this.model.getCursorTrack();
d.setCell(1, 8, cursorTrack == null ? "" : StringUtils.fixASCII(cursorTrack.getName(9)));
this.drawRow4();
this.setButtonInfo(d);
d.allDone();
}
use of de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay in project DrivenByMoss by git-moss.
the class SLMkIIITrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final SLMkIIIDisplay d = this.surface.getDisplay();
d.clear();
d.setCell(0, 8, "Track");
final ITrack cursorTrack = this.model.getCursorTrack();
if (!cursorTrack.doesExist()) {
d.setBlock(1, 1, " Please select a").setBlock(1, 2, "track.");
d.setCell(1, 8, "");
d.hideAllElements();
} else {
d.setCell(0, 0, "Volume").setCell(1, 0, cursorTrack.getVolumeStr(9));
d.setPropertyColor(0, 0, SLMkIIIColorManager.SLMKIII_BLUE);
d.setPropertyColor(0, 1, SLMkIIIColorManager.SLMKIII_BLUE);
d.setCell(0, 1, "Pan").setCell(1, 1, cursorTrack.getPanStr(9));
d.setPropertyColor(1, 0, SLMkIIIColorManager.SLMKIII_ORANGE);
d.setPropertyColor(1, 1, SLMkIIIColorManager.SLMKIII_ORANGE);
final ISendBank sendBank = cursorTrack.getSendBank();
for (int i = 0; i < 6; i++) {
final int pos = 2 + i;
int color = SLMkIIIColorManager.SLMKIII_BLACK;
if (sendBank.getItemCount() > 0) {
final ISend send = sendBank.getItem(i);
if (send.doesExist()) {
d.setCell(0, pos, send.getName(9)).setCell(1, pos, send.getDisplayedValue(9));
color = SLMkIIIColorManager.SLMKIII_YELLOW;
}
}
d.setPropertyColor(pos, 0, color);
d.setPropertyColor(pos, 1, color);
}
d.setCell(1, 8, StringUtils.fixASCII(cursorTrack.getName(9)));
}
this.drawRow4();
this.setButtonInfo(d);
d.allDone();
}
use of de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay in project DrivenByMoss by git-moss.
the class NoteMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final SLMkIIIDisplay d = this.surface.getDisplay();
d.clear();
d.setCell(0, 8, "Note Edit");
if (this.notes.isEmpty()) {
d.setBlock(1, 1, " Please select a").setBlock(1, 2, "note.");
d.setCell(1, 8, "");
d.hideAllElements();
for (int i = 0; i < 8; i++) d.setPropertyColor(i, 2, SLMkIIIColorManager.SLMKIII_BLACK);
} else {
final GridStep noteInfo = this.notes.get(0);
final int channel = noteInfo.channel();
final int step = noteInfo.step();
final int note = noteInfo.note();
final IStepInfo stepInfo = this.clip.getStep(channel, step, note);
if (this.page != Page.RECCURRENCE_PATTERN) {
d.setCell(0, 0, "Length").setCell(1, 0, this.formatLength(stepInfo.getDuration()));
d.setCell(0, 1, " Mute");
if (stepInfo.isMuted())
d.setCell(1, 1, " MUTED");
d.setPropertyColor(0, 0, SLMkIIIColorManager.SLMKIII_ROSE);
d.setPropertyColor(0, 1, SLMkIIIColorManager.SLMKIII_BLACK);
d.setPropertyColor(1, 0, SLMkIIIColorManager.SLMKIII_ROSE);
d.setPropertyColor(1, 1, SLMkIIIColorManager.SLMKIII_BLACK);
final int size = this.notes.size();
final boolean isOneNote = size == 1;
d.setCell(2, 0, isOneNote ? "Step: " + (step + 1) : "Notes: " + size);
d.setCell(2, 1, isOneNote ? Scales.formatNoteAndOctave(note, -3) : "*");
}
switch(this.page) {
case NOTE:
d.setCell(1, 8, "Common");
d.setPropertyValue(0, 1, 1);
setColor(d, 2, true);
d.setCell(0, 2, "Velocity");
d.setCell(1, 2, StringUtils.formatPercentage(stepInfo.getVelocity()));
d.setPropertyColor(2, 2, SLMkIIIColorManager.SLMKIII_BLACK);
final boolean supportsVelocitySpread = this.host.supports(Capability.NOTE_EDIT_VELOCITY_SPREAD);
setColor(d, 3, supportsVelocitySpread);
d.setPropertyColor(3, 2, SLMkIIIColorManager.SLMKIII_BLACK);
if (supportsVelocitySpread) {
d.setCell(0, 3, "V-Spread");
d.setCell(1, 3, StringUtils.formatPercentage(stepInfo.getVelocitySpread()));
}
final boolean supportsReleaseVelocity = this.host.supports(Capability.NOTE_EDIT_RELEASE_VELOCITY);
setColor(d, 4, supportsReleaseVelocity);
d.setPropertyColor(4, 2, SLMkIIIColorManager.SLMKIII_BLACK);
if (supportsReleaseVelocity) {
d.setCell(0, 4, "R-Velcty");
d.setCell(1, 4, StringUtils.formatPercentage(stepInfo.getReleaseVelocity()));
}
final boolean supportsChance = this.host.supports(Capability.NOTE_EDIT_CHANCE);
setColor(d, 5, supportsChance);
if (supportsChance) {
d.setCell(0, 5, "Chance");
d.setCell(1, 5, StringUtils.formatPercentage(stepInfo.getChance()));
d.setCell(3, 5, stepInfo.isChanceEnabled() ? ON : OFF);
d.setPropertyColor(5, 2, SLMkIIIColorManager.SLMKIII_ROSE);
d.setPropertyValue(5, 1, stepInfo.isChanceEnabled() ? 1 : 0);
}
final boolean supportsOccurrence = this.host.supports(Capability.NOTE_EDIT_OCCURRENCE);
d.setPropertyColor(6, 0, supportsOccurrence ? SLMkIIIColorManager.SLMKIII_ROSE : SLMkIIIColorManager.SLMKIII_BLACK);
d.setPropertyColor(6, 1, SLMkIIIColorManager.SLMKIII_BLACK);
if (supportsOccurrence) {
d.setCell(0, 6, "Occurnce");
d.setCell(1, 6, StringUtils.optimizeName(stepInfo.getOccurrence().getName(), 8));
d.setCell(3, 6, stepInfo.isOccurrenceEnabled() ? ON : OFF);
d.setPropertyColor(6, 2, SLMkIIIColorManager.SLMKIII_ROSE);
d.setPropertyValue(6, 1, stepInfo.isOccurrenceEnabled() ? 1 : 0);
}
final boolean supportsRecurrence = this.host.supports(Capability.NOTE_EDIT_RECCURRENCE);
setColor(d, 7, supportsRecurrence);
if (supportsRecurrence) {
final int recurrence = stepInfo.getRecurrenceLength();
final String recurrenceStr = recurrence < 2 ? "Off" : Integer.toString(recurrence);
d.setCell(0, 7, "Recurnce");
d.setCell(1, 7, recurrenceStr);
d.setCell(3, 7, stepInfo.isRecurrenceEnabled() ? ON : OFF);
d.setPropertyColor(7, 2, SLMkIIIColorManager.SLMKIII_ROSE);
d.setPropertyValue(7, 1, stepInfo.isRecurrenceEnabled() ? 1 : 0);
}
break;
case EXPRESSIONS:
if (this.host.supports(Capability.NOTE_EDIT_EXPRESSIONS)) {
for (int i = 3; i < 8; i++) d.setPropertyColor(i, 2, SLMkIIIColorManager.SLMKIII_BLACK);
d.setCell(1, 8, "Expressions");
setColor(d, 2, false);
setColor(d, 3, true);
d.setCell(0, 3, "Gain").setCell(1, 3, StringUtils.formatPercentage(stepInfo.getGain()));
setColor(d, 4, true);
d.setCell(0, 4, "Pan").setCell(1, 4, StringUtils.formatPercentage(stepInfo.getPan()));
setColor(d, 5, true);
d.setCell(0, 5, "Pitch").setCell(1, 5, String.format("%.1f", Double.valueOf(stepInfo.getTranspose())));
setColor(d, 6, true);
d.setCell(0, 6, "Timbre").setCell(1, 6, StringUtils.formatPercentage(stepInfo.getTimbre()));
setColor(d, 7, true);
d.setCell(0, 7, "Pressure").setCell(1, 7, StringUtils.formatPercentage(stepInfo.getPressure()));
}
break;
case REPEAT:
final int repeatColor = stepInfo.isRepeatEnabled() ? SLMkIIIColorManager.SLMKIII_AMBER : SLMkIIIColorManager.SLMKIII_AMBER_HALF;
for (int i = 3; i < 8; i++) d.setPropertyColor(i, 2, i == 4 ? repeatColor : SLMkIIIColorManager.SLMKIII_BLACK);
d.setCell(1, 8, "Repeat");
setColor(d, 2, false);
setColor(d, 3, false);
setColor(d, 4, true);
d.setCell(0, 4, "Count");
d.setCell(1, 4, stepInfo.getFormattedRepeatCount());
d.setCell(3, 4, stepInfo.isRepeatEnabled() ? ON : OFF);
final double repeatCurve = stepInfo.getRepeatCurve();
setColor(d, 5, true);
d.setCell(0, 5, "Curve");
d.setCell(1, 5, StringUtils.formatPercentage(repeatCurve));
final double repeatVelocityCurve = stepInfo.getRepeatVelocityCurve();
setColor(d, 6, true);
d.setCell(0, 6, "Vel-Crve");
d.setCell(1, 6, StringUtils.formatPercentage(repeatVelocityCurve));
final double repeatVelocityEnd = stepInfo.getRepeatVelocityEnd();
setColor(d, 7, true);
d.setCell(0, 7, "Vel. End");
d.setCell(1, 7, StringUtils.formatPercentage(repeatVelocityEnd));
break;
case RECCURRENCE_PATTERN:
d.setCell(1, 8, "Pattern");
for (int i = 3; i < 8; i++) d.setPropertyColor(i, 2, SLMkIIIColorManager.SLMKIII_BLACK);
final int recurrenceLength = stepInfo.getRecurrenceLength();
final int mask = stepInfo.getRecurrenceMask();
for (int i = 0; i < 8; i++) {
final boolean isOn = (mask & 1 << i) > 0;
String label = " -";
final boolean active = i < recurrenceLength;
if (active)
label = i + 1 + ": " + (isOn ? "On" : "Off");
d.setCell(0, i, label);
d.setPropertyColor(i, 0, active ? SLMkIIIColorManager.SLMKIII_ROSE : SLMkIIIColorManager.SLMKIII_BLACK);
d.setPropertyColor(i, 1, SLMkIIIColorManager.SLMKIII_BLACK);
}
break;
}
}
this.setButtonInfo(d);
d.allDone();
}
use of de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay in project DrivenByMoss by git-moss.
the class ParametersMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final SLMkIIIDisplay d = this.surface.getDisplay();
d.clear();
final ICursorDevice cd = this.model.getCursorDevice();
if (!cd.doesExist()) {
d.setBlock(1, 1, " Please select or").setBlock(1, 2, "add a device.");
d.setCell(0, 8, "No device");
d.hideAllElements();
// Row 4
this.drawRow4(d, cd, null);
} else {
final IParameterPageBank parameterPageBank = cd.getParameterPageBank();
final Optional<String> selectedPage = parameterPageBank.getSelectedItem();
d.setCell(0, 8, cd.getName(9)).setCell(1, 8, selectedPage.isPresent() ? selectedPage.get() : "");
// Row 1 & 2
for (int i = 0; i < 8; i++) {
final IParameterBank parameterBank = cd.getParameterBank();
final IParameter param = parameterBank.getItem(i);
d.setCell(0, i, param.doesExist() ? StringUtils.fixASCII(param.getName(9)) : "").setCell(1, i, param.getDisplayedValue(9));
final int color = param.doesExist() ? SLMkIIIColorManager.SLMKIII_PURPLE : SLMkIIIColorManager.SLMKIII_BLACK;
d.setPropertyColor(i, 0, color);
d.setPropertyColor(i, 1, color);
}
// Row 4
this.drawRow4(d, cd, parameterPageBank);
}
this.setButtonInfo(d);
d.allDone();
}
use of de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay in project DrivenByMoss by git-moss.
the class AbstractTrackMode method drawRow4.
/**
* Draw the row with track names.
*/
protected void drawRow4() {
final SLMkIIIDisplay d = this.surface.getDisplay();
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> selectedTrack = tb.getSelectedItem();
if (this.surface.isShiftPressed()) {
this.drawRow4Shifted(d, selectedTrack.isPresent() ? selectedTrack.get() : EmptyTrack.INSTANCE);
return;
}
if (this.surface.isLongPressed(ButtonID.ARROW_DOWN)) {
final ModeManager modeManager = this.surface.getModeManager();
for (int i = 0; i < 8; i++) {
d.setCell(3, i, MODE_MENU[i]);
d.setPropertyColor(i, 2, SLMkIIIColorManager.SLMKIII_GREEN);
d.setPropertyValue(i, 1, modeManager.isActive(MODES[i]) ? 1 : 0);
}
return;
}
// Format track names
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
d.setCell(3, i, StringUtils.shortenAndFixASCII(t.getName(9), 9));
final boolean exists = t.doesExist();
int color;
if (t.isActivated()) {
final String colorIndex = DAWColor.getColorIndex(t.getColor());
color = this.model.getColorManager().getColorIndex(colorIndex);
} else
color = SLMkIIIColorManager.SLMKIII_DARK_GREY;
d.setPropertyColor(i, 2, color);
d.setPropertyValue(i, 1, exists && t.isSelected() ? 1 : 0);
}
}
Aggregations