use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class MasterMode method updateKnobLEDs.
/**
* {@inheritDoc}
*/
@Override
public void updateKnobLEDs() {
final IMasterTrack masterTrack = this.model.getMasterTrack();
final int upperBound = this.model.getValueChanger().getUpperBound();
this.surface.setKnobLED(0, MCUControlSurface.KNOB_LED_MODE_WRAP, masterTrack.getVolume(), upperBound);
this.surface.setKnobLED(1, MCUControlSurface.KNOB_LED_MODE_BOOST_CUT, masterTrack.getPan(), upperBound);
for (int i = 0; i < 6; i++) this.surface.setKnobLED(2 + i, MCUControlSurface.KNOB_LED_MODE_WRAP, 0, upperBound);
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class LaunchkeyMk3SendMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final ITextDisplay d = this.surface.getTextDisplay();
final ICursorTrack cursorTrack = this.model.getCursorTrack();
final String trackText = cursorTrack.doesExist() ? String.format("%d: %s", Integer.valueOf(cursorTrack.getPosition() + 1), cursorTrack.getName()) : "No sel. track";
final ITrackBank tb = this.model.getCurrentTrackBank();
if (this.areKnobs) {
String sendName = tb.getEditSendName(this.sendIndex);
sendName = StringUtils.optimizeName(sendName.isEmpty() ? "Send " + (this.sendIndex + 1) : sendName, 6);
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE, 0, sendName + this.formatPageRange(" %d - %d"));
d.setCell(LaunchkeyMk3Display.SCREEN_ROW_BASE + 1, 0, trackText);
}
final int row = this.areKnobs ? LaunchkeyMk3Display.SCREEN_ROW_POTS : LaunchkeyMk3Display.SCREEN_ROW_FADERS;
// Format track names
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
final ISend s = t.getSendBank().getItem(this.sendIndex);
final boolean exists = s.doesExist();
final int offset = i * 2;
d.setCell(row + offset, 0, exists ? String.format("%d: %s", Integer.valueOf(s.getPosition() + 1), s.getName()) : "No send");
d.setCell(row + offset + 1, 0, exists ? "S-Vol: " + s.getDisplayedValue() : "");
}
// Add master fader
if (!this.areKnobs) {
final IMasterTrack masterTrack = this.model.getMasterTrack();
d.setCell(row + 16, 0, "Master");
d.setCell(row + 16 + 1, 0, "Vol: " + masterTrack.getVolumeStr());
}
d.allDone();
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class MasterMode method setActive.
private void setActive(final boolean enable) {
final IMasterTrack mt = this.model.getMasterTrack();
mt.setVolumeIndication(enable);
mt.setPanIndication(enable);
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class TrackDetailsMode method getSelectedTrack.
private ITrack getSelectedTrack() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t = tb.getSelectedTrack();
if (t != null)
return t;
final IMasterTrack master = this.model.getMasterTrack();
return master.isSelected() ? master : null;
}
use of de.mossgrabers.framework.daw.data.IMasterTrack in project DrivenByMoss by git-moss.
the class VolumeMode method updateDisplay.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay() {
final Display d = this.surface.getDisplay();
final IMasterTrack masterTrack = this.model.getMasterTrack();
if (masterTrack.isSelected()) {
d.clear();
final String n = StringUtils.shortenAndFixASCII(masterTrack.getName(), 7);
d.setCell(1, 0, SLDisplay.RIGHT_ARROW + n).setCell(3, 0, masterTrack.getVolumeStr(8)).done(1).done(3);
return;
}
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selTrack = tb.getSelectedTrack();
final int selIndex = selTrack == null ? -1 : selTrack.getIndex();
for (int i = 0; i < 8; i++) {
final boolean isSel = i == selIndex;
final ITrack t = tb.getTrack(i);
final String n = StringUtils.shortenAndFixASCII(t.getName(), isSel ? 7 : 8);
d.setCell(1, i, isSel ? SLDisplay.RIGHT_ARROW + n : n).setCell(3, i, t.getVolumeStr(8));
}
d.done(1).done(3);
}
Aggregations