use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class QuantizeMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2(final IGraphicDisplay display) {
final ITrack cursorTrack = this.model.getCursorTrack();
final RecordQuantization recQuant = cursorTrack.doesExist() ? cursorTrack.getRecordQuantizationGrid() : RecordQuantization.RES_OFF;
final RecordQuantization[] values = RecordQuantization.values();
for (int i = 0; i < values.length; i++) display.addOptionElement("", MENU[i], i == 0, i == 0 ? "Record Quantization" : "", values[i].getName(), values[i] == recQuant, true);
if (this.model.getHost().supports(Capability.QUANTIZE_INPUT_NOTE_LENGTH)) {
display.addOptionElement("", " ", false, null, "Quantize Note Length", "", false, null, true);
final boolean isQuantLength = cursorTrack.doesExist() && cursorTrack.isRecordQuantizationNoteLength();
display.addOptionElement("", " ", false, "", isQuantLength ? "On" : "Off", isQuantLength, true);
} else {
display.addEmptyElement(true);
display.addEmptyElement(true);
}
if (this.model.getHost().supports(Capability.QUANTIZE_AMOUNT)) {
final int quantizeAmount = this.surface.getConfiguration().getQuantizeAmount();
display.addParameterElement(" ", false, "", (ChannelType) null, null, false, "Qunt Amnt", quantizeAmount * 1023 / 100, quantizeAmount + "%", this.isKnobTouched[0], -1);
} else
display.addEmptyElement(true);
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class AbstractTrackMode method updateStopMenu.
protected void updateStopMenu() {
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() ? "Stop Clip" : "", Boolean.valueOf(t.isPlaying()));
}
}
use of de.mossgrabers.framework.daw.data.ITrack 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.ITrack 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.ITrack 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