use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class SendMode method resetParameter.
/**
* {@inheritDoc}
*/
@Override
protected void resetParameter(final int index) {
final int extenderOffset = this.getExtenderOffset();
final ISendBank sendBank = this.getTrackBank().getItem(extenderOffset + index).getSendBank();
if (this.sendIndex < sendBank.getPageSize())
sendBank.getItem(this.sendIndex).resetValue();
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class SendMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
if (!this.surface.getConfiguration().hasDisplay1())
return;
if (this.model.isEffectTrackBankActive()) {
this.surface.getModeManager().setActive(Modes.TRACK);
return;
}
this.drawDisplay2();
if (!this.drawTrackHeader())
return;
final ITextDisplay d = this.surface.getTextDisplay();
final ITrackBank tb = this.getTrackBank();
if (!tb.canEditSend(this.sendIndex)) {
d.notify("Send channel " + (this.sendIndex + 1) + " does not exist.");
return;
}
final int extenderOffset = this.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(extenderOffset + i);
final ISendBank sendBank = t.getSendBank();
d.setCell(1, i, this.sendIndex < sendBank.getPageSize() ? sendBank.getItem(this.sendIndex).getDisplayedValue(6) : "");
}
d.done(1);
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class SendMode method updateKnobLEDs.
/**
* {@inheritDoc}
*/
@Override
public void updateKnobLEDs() {
final ITrackBank tb = this.getTrackBank();
if (this.model.isEffectTrackBankActive()) {
this.surface.getModeManager().setActive(Modes.TRACK);
return;
}
final int upperBound = this.model.getValueChanger().getUpperBound();
final int extenderOffset = this.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(extenderOffset + i);
final ISendBank sendBank = t.getSendBank();
this.surface.setKnobLED(i, MCUControlSurface.KNOB_LED_MODE_WRAP, this.sendIndex < sendBank.getPageSize() ? sendBank.getItem(this.sendIndex).getValue() : 0, upperBound);
}
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class SendMode method drawTrackHeader.
/**
* {@inheritDoc}
*/
@Override
protected boolean drawTrackHeader() {
if (this.model.isEffectTrackBankActive()) {
this.surface.getModeManager().setActive(Modes.TRACK);
return true;
}
if (!super.drawTrackHeader())
return false;
if (this.surface.getConfiguration().isDisplayTrackNames())
return true;
final ITextDisplay d = this.surface.getTextDisplay();
final ITrackBank tb = this.getTrackBank();
final int extenderOffset = this.getExtenderOffset();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(extenderOffset + i);
if (t.doesExist()) {
final ISendBank sendBank = t.getSendBank();
d.setCell(0, i, StringUtils.shortenAndFixASCII(this.sendIndex < sendBank.getPageSize() ? sendBank.getItem(this.sendIndex).getName(6) : "", 6));
} else
d.clearCell(0, i);
}
d.done(0);
return true;
}
use of de.mossgrabers.framework.daw.data.bank.ISendBank in project DrivenByMoss by git-moss.
the class SendMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final IValueChanger valueChanger = this.model.getValueChanger();
final Optional<ITrack> selectedTrack = this.bank.getSelectedItem();
final ISendBank sendBank = selectedTrack.isEmpty() ? null : selectedTrack.get().getSendBank();
final int[] vuData = new int[16];
for (int i = 0; i < 8; i++) {
final ISend send = sendBank == null ? EmptySend.INSTANCE : sendBank.getItem(i);
this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_AVAILABLE, send.doesExist() ? TrackType.RETURN_BUS : TrackType.EMPTY, i);
this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_SELECTED, send.isSelected() ? 1 : 0, i);
this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_RECARM, 0, i);
this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_VOLUME_TEXT, 0, i, send.getDisplayedValue(8));
this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_PAN_TEXT, 0, i, send.getDisplayedValue(8));
final String n = selectedTrack.isPresent() ? getName(selectedTrack.get(), send) : "";
this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_NAME, 0, i, n);
final int j = 2 * i;
vuData[j] = valueChanger.toMidiValue(send.getModulatedValue());
vuData[j + 1] = valueChanger.toMidiValue(send.getModulatedValue());
}
this.surface.sendKontrolTrackSysEx(KontrolProtocolControlSurface.KONTROL_TRACK_VU, 2, 0, vuData);
}
Aggregations