use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class SendMode method getName.
/**
* {@inheritDoc}
*/
@Override
public String getName() {
final Optional<ITrack> selectedTrack = this.model.getTrackBank().getSelectedItem();
String name = "-";
if (selectedTrack.isPresent()) {
final ISend send = selectedTrack.get().getSendBank().getItem(this.sendIndex);
if (send.doesExist())
name = send.getName();
}
return super.getName() + ": " + name;
}
use of de.mossgrabers.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
if (!this.surface.getConfiguration().hasDisplay1())
return;
this.drawDisplay2();
if (!this.drawTrackHeader())
return;
final ITextDisplay d = this.surface.getTextDisplay().clear();
final Optional<ITrack> selectedTrack = this.getSelectedTrack();
if (selectedTrack.isEmpty()) {
d.notify("Please select a track...");
return;
}
final boolean displayTrackNames = this.surface.getConfiguration().isDisplayTrackNames();
if (!displayTrackNames) {
d.setCell(0, 0, "Volume");
d.setCell(0, 1, "Pan");
}
final ITrack t = selectedTrack.get();
d.setCell(1, 0, t.getVolumeStr(6));
d.setCell(1, 1, t.getPanStr(6));
final int sendStart = 2;
final int sendCount = 6;
final boolean isEffectTrackBankActive = this.model.isEffectTrackBankActive();
final ISendBank sendBank = t.getSendBank();
for (int i = 0; i < sendCount; i++) {
final int pos = sendStart + i;
if (!isEffectTrackBankActive && i < sendBank.getItemCount()) {
final ISend send = sendBank.getItem(i);
if (send.doesExist()) {
if (!displayTrackNames)
d.setCell(0, pos, StringUtils.fixASCII(send.getName()));
d.setCell(1, pos, send.getDisplayedValue(6));
}
}
}
if (!displayTrackNames)
d.done(0);
d.done(1);
}
use of de.mossgrabers.framework.daw.data.ISend 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.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class SLMkIIISendMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final SLMkIIIDisplay d = this.surface.getDisplay();
d.clear();
d.setCell(0, 8, "Send " + (this.sendIndex + 1));
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
int color = SLMkIIIColorManager.SLMKIII_BLACK;
final ITrack t = tb.getItem(i);
if (t.doesExist()) {
final ISend send = t.getSendBank().getItem(this.sendIndex);
if (send.doesExist()) {
d.setCell(0, i, send.getName(9)).setCell(1, i, send.getDisplayedValue(9));
color = SLMkIIIColorManager.SLMKIII_YELLOW;
}
}
this.setColumnColors(d, i, t, color);
}
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.framework.daw.data.ISend in project DrivenByMoss by git-moss.
the class MaschineSendSelectCommand method executeNormal.
/**
* {@inheritDoc}
*/
@Override
public void executeNormal(final ButtonEvent event) {
final ModeManager modeManager = this.surface.getModeManager();
final Modes activeMode = modeManager.getActiveID();
super.executeNormal(event);
final Modes newMode = modeManager.getActiveID();
if (activeMode == newMode)
return;
final int sendIndex = newMode.ordinal() - Modes.SEND1.ordinal();
final Optional<ITrack> t = this.model.getCurrentTrackBank().getSelectedItem();
if (t.isEmpty())
return;
final ISendBank sendBank = t.get().getSendBank();
final ISend send = sendBank.getItem(sendIndex);
if (send.doesExist())
this.surface.getDisplay().notify("Send " + (sendIndex + 1) + ": " + send.getName());
}
Aggregations