use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method updateTrackMenu.
protected void updateTrackMenu(final int selectedMenu) {
final PushConfiguration config = this.surface.getConfiguration();
this.menu.get(0).set("Volume", Boolean.valueOf(selectedMenu - 1 == 0));
this.menu.get(1).set("Pan", Boolean.valueOf(selectedMenu - 1 == 1));
this.menu.get(2).set(this.model.getHost().supports(Capability.HAS_CROSSFADER) ? "Crossfader" : " ", Boolean.valueOf(selectedMenu - 1 == 2));
if (this.model.isEffectTrackBankActive()) {
// No sends for FX tracks
for (int i = 3; i < 7; i++) this.menu.get(i).set(" ", Boolean.FALSE);
return;
}
final boolean sendsAreToggled = config.isSendsAreToggled();
this.menu.get(3).set(sendsAreToggled ? "Sends 5-8" : "Sends 1-4", Boolean.valueOf(sendsAreToggled));
final ITrackBank tb = this.model.getCurrentTrackBank();
final int sendOffset = sendsAreToggled ? 4 : 0;
for (int i = 0; i < 4; i++) {
final String sendName = tb.getEditSendName(sendOffset + i);
final boolean exists = !sendName.isEmpty();
this.menu.get(4 + i).set(exists ? sendName : " ", Boolean.valueOf(exists && 4 + i == selectedMenu - 1));
}
if (this.lastSendIsAccessible())
return;
final boolean isUpAvailable = tb.hasParent();
this.menu.get(7).set(isUpAvailable ? "Up" : " ", Boolean.valueOf(isUpAvailable));
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method updateMuteMenu.
protected void updateMuteMenu() {
final ITrackBank tb = this.model.getCurrentTrackBank();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getItem(i);
this.menu.get(i).set(t.doesExist() ? "Mute" : "", Boolean.valueOf(t.isMute()));
}
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class AbstractTrackMode method getButtonColor.
/**
* {@inheritDoc}
*/
@Override
public int getButtonColor(final ButtonID buttonID) {
final PushConfiguration config = this.surface.getConfiguration();
final ITrackBank tb = this.model.getCurrentTrackBank();
int index = this.isButtonRow(0, buttonID);
if (index >= 0) {
final ITrack track = tb.getItem(index);
if (!track.doesExist() || !track.isActivated())
return this.colorManager.getColorIndex(PushColorManager.PUSH_BLACK);
final ITrack cursorTrack = this.model.getCursorTrack();
final int selIndex = cursorTrack.doesExist() ? cursorTrack.getIndex() : -1;
final boolean isSel = track.getIndex() == selIndex;
if (track.isRecArm())
return this.colorManager.getColorIndex(isSel ? PushColorManager.PUSH_RED_HI : PushColorManager.PUSH_RED_LO);
return this.colorManager.getColorIndex(isSel ? PushColorManager.PUSH_ORANGE_HI : PushColorManager.PUSH_YELLOW_LO);
}
index = this.isButtonRow(1, buttonID);
if (index >= 0) {
final ITrack track = tb.getItem(index);
if (this.isPush2) {
if (this.surface.isPressed(ButtonID.STOP_CLIP))
return track.doesExist() && track.isPlaying() ? PushColorManager.PUSH2_COLOR_RED_HI : PushColorManager.PUSH2_COLOR_BLACK;
if (config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
final boolean muteState = config.isMuteState();
return this.getTrackStateColor(muteState, track);
}
final ModeManager modeManager = this.surface.getModeManager();
final boolean sendsAreToggled = config.isSendsAreToggled();
switch(index) {
case 0:
return modeManager.isActive(Modes.VOLUME) ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH2_COLOR_BLACK;
case 1:
return modeManager.isActive(Modes.PAN) ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH2_COLOR_BLACK;
case 2:
return modeManager.isActive(Modes.CROSSFADER) ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH2_COLOR_BLACK;
case 4:
final Modes sendMode1 = sendsAreToggled ? Modes.SEND5 : Modes.SEND1;
return modeManager.isActive(sendMode1) ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH2_COLOR_BLACK;
case 5:
final Modes sendMode2 = sendsAreToggled ? Modes.SEND6 : Modes.SEND2;
return modeManager.isActive(sendMode2) ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH2_COLOR_BLACK;
case 6:
final Modes sendMode3 = sendsAreToggled ? Modes.SEND7 : Modes.SEND3;
return modeManager.isActive(sendMode3) ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH2_COLOR_BLACK;
case 7:
if (this.lastSendIsAccessible()) {
final Modes sendMode4 = sendsAreToggled ? Modes.SEND8 : Modes.SEND4;
return modeManager.isActive(sendMode4) ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH2_COLOR_BLACK;
}
return tb.hasParent() ? PushColorManager.PUSH2_COLOR2_WHITE : PushColorManager.PUSH2_COLOR_BLACK;
default:
case 3:
return PushColorManager.PUSH2_COLOR_BLACK;
}
}
final boolean muteState = config.isMuteState();
if (!track.doesExist())
return PushColorManager.PUSH1_COLOR_BLACK;
if (muteState)
return track.isMute() ? PushColorManager.PUSH1_COLOR_BLACK : PushColorManager.PUSH1_COLOR2_YELLOW_HI;
return track.isSolo() ? PushColorManager.PUSH1_COLOR2_BLUE_HI : PushColorManager.PUSH1_COLOR2_GREY_LO;
}
return super.getButtonColor(buttonID);
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class DeviceLayerMode method updateLayerMenu.
protected void updateLayerMenu(final int selectedMenu) {
this.menu.get(0).set("Volume", Boolean.valueOf(selectedMenu - 1 == 0));
this.menu.get(1).set("Pan", Boolean.valueOf(selectedMenu - 1 == 1));
this.menu.get(2).set(" ", Boolean.FALSE);
if (this.model.isEffectTrackBankActive()) {
// No sends for FX tracks
for (int i = 3; i < 7; i++) this.menu.get(i).set(" ", Boolean.FALSE);
return;
}
final boolean sendsAreToggled = this.configuration.isSendsAreToggled();
this.menu.get(3).set(sendsAreToggled ? "Sends 5-8" : "Sends 1-4", Boolean.valueOf(sendsAreToggled));
final ITrackBank tb = this.model.getCurrentTrackBank();
final int sendOffset = sendsAreToggled ? 4 : 0;
for (int i = 0; i < 4; i++) {
final String sendName = tb.getEditSendName(sendOffset + i);
this.menu.get(4 + i).set(sendName.isEmpty() ? " " : sendName, Boolean.valueOf(4 + i == selectedMenu - 1));
}
if (!this.surface.isShiftPressed() && !this.isKnobTouched(7))
this.menu.get(7).set("Up", Boolean.TRUE);
}
use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.
the class TrackMode method updateDisplay1.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay1(final ITextDisplay display) {
final ITrackBank tb = this.model.getCurrentTrackBank();
final Optional<ITrack> track = tb.getSelectedItem();
if (track.isEmpty())
display.setRow(1, " Please selecta track... ");
else {
final ITrack t = track.get();
final PushConfiguration config = this.surface.getConfiguration();
final int upperBound = this.model.getValueChanger().getUpperBound();
final String volValueStr = config.isEnableVUMeters() ? Push1Display.formatValue(t.getVolume(), t.getVu(), upperBound) : Push1Display.formatValue(t.getVolume(), upperBound);
display.setCell(0, 0, "Volume").setCell(1, 0, t.getVolumeStr(8)).setCell(2, 0, volValueStr);
display.setCell(0, 1, "Pan").setCell(1, 1, t.getPanStr(8)).setCell(2, 1, t.getPan(), Format.FORMAT_PAN);
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) {
final ISend send = sendBank.getItem(i);
if (send.doesExist())
display.setCell(0, pos, send.getName()).setCell(1, pos, send.getDisplayedValue(8)).setCell(2, pos, send.getValue(), Format.FORMAT_VALUE);
}
}
}
this.drawRow4(display);
}
Aggregations