use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class AbstractTrackMode method drawRow4.
protected void drawRow4() {
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selTrack = tb.getSelectedTrack();
// Format track names
final int selIndex = selTrack == null ? -1 : selTrack.getIndex();
final Display d = this.surface.getDisplay();
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(3, i, isSel ? PushDisplay.RIGHT_ARROW + n : n);
}
d.done(3);
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class AbstractTrackMode method getTrackButtonColor.
protected int getTrackButtonColor(final ITrack track) {
if (!track.doesExist() || !track.isActivated())
return this.isPush2 ? PushColors.PUSH2_COLOR_BLACK : PushColors.PUSH1_COLOR_BLACK;
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack selTrack = tb.getSelectedTrack();
final int selIndex = selTrack == null ? -1 : selTrack.getIndex();
final boolean isSel = track.getIndex() == selIndex;
if (track.isRecArm())
return isSel ? this.isPush2 ? PushColors.PUSH2_COLOR_RED_HI : PushColors.PUSH1_COLOR_RED_HI : this.isPush2 ? PushColors.PUSH2_COLOR_RED_LO : PushColors.PUSH1_COLOR_RED_LO;
return isSel ? this.isPush2 ? PushColors.PUSH2_COLOR_ORANGE_HI : PushColors.PUSH1_COLOR_ORANGE_HI : this.isPush2 ? PushColors.PUSH2_COLOR_YELLOW_LO : PushColors.PUSH1_COLOR_YELLOW_LO;
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class AbstractTrackMode method onFirstRow.
/**
* {@inheritDoc}
*/
@Override
public void onFirstRow(final int index, final ButtonEvent event) {
if (event == ButtonEvent.DOWN)
return;
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack track = tb.getTrack(index);
if (event == ButtonEvent.UP) {
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_DUPLICATE)) {
this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_DUPLICATE);
track.duplicate();
return;
}
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP)) {
this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_CLIP_STOP);
track.stop();
return;
}
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_RECORD)) {
this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_RECORD);
track.toggleRecArm();
return;
}
final ITrack selTrack = tb.getSelectedTrack();
if (selTrack != null && selTrack.getIndex() == index) {
// mode
if (selTrack.isGroup() && tb instanceof ITrackBank)
((ITrackBank) tb).selectChildren();
else
this.surface.getViewManager().getActiveView().executeTriggerCommand(Commands.COMMAND_DEVICE, ButtonEvent.DOWN);
} else
track.selectAndMakeVisible();
return;
}
// LONG press, go out of group
if (!this.model.isEffectTrackBankActive()) {
this.model.getTrackBank().selectParent();
this.surface.setButtonConsumed(PushControlSurface.PUSH_BUTTON_ROW1_1 + index);
}
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class AbstractTrackMode method updateSecondRow.
/**
* {@inheritDoc}
*/
@Override
public void updateSecondRow() {
final PushConfiguration config = this.surface.getConfiguration();
final IChannelBank tb = this.model.getCurrentTrackBank();
if (this.isPush2) {
if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP)) {
for (int i = 0; i < 8; i++) {
final ITrack track = tb.getTrack(i);
this.surface.updateButton(102 + i, track.doesExist() && track.isPlaying() ? PushColors.PUSH2_COLOR_RED_HI : PushColors.PUSH2_COLOR_BLACK);
}
return;
}
if (config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
final boolean muteState = config.isMuteState();
for (int i = 0; i < 8; i++) this.surface.updateButton(102 + i, this.getTrackStateColor(muteState, tb.getTrack(i)));
return;
}
final ModeManager modeManager = this.surface.getModeManager();
this.surface.updateButton(102, modeManager.isActiveMode(Modes.MODE_VOLUME) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(103, modeManager.isActiveMode(Modes.MODE_PAN) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(104, modeManager.isActiveMode(Modes.MODE_CROSSFADER) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(105, PushColors.PUSH2_COLOR_BLACK);
final boolean sendsAreToggled = config.isSendsAreToggled();
this.surface.updateButton(106, modeManager.isActiveMode(sendsAreToggled ? Modes.MODE_SEND5 : Modes.MODE_SEND1) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(107, modeManager.isActiveMode(sendsAreToggled ? Modes.MODE_SEND6 : Modes.MODE_SEND2) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(108, modeManager.isActiveMode(sendsAreToggled ? Modes.MODE_SEND7 : Modes.MODE_SEND3) ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
this.surface.updateButton(109, tb instanceof ITrackBank && ((ITrackBank) tb).hasParent() ? PushColors.PUSH2_COLOR2_WHITE : PushColors.PUSH2_COLOR_BLACK);
return;
}
final boolean muteState = config.isMuteState();
for (int i = 0; i < 8; i++) {
final ITrack t = tb.getTrack(i);
int color = PushColors.PUSH1_COLOR_BLACK;
if (t.doesExist()) {
if (muteState) {
if (!t.isMute())
color = PushColors.PUSH1_COLOR2_YELLOW_HI;
} else
color = t.isSolo() ? PushColors.PUSH1_COLOR2_BLUE_HI : PushColors.PUSH1_COLOR2_GREY_LO;
}
this.surface.updateButton(102 + i, color);
}
}
use of de.mossgrabers.framework.daw.data.ITrack in project DrivenByMoss by git-moss.
the class ClipMode method updateDisplay2.
/**
* {@inheritDoc}
*/
@Override
public void updateDisplay2() {
final ICursorClip clip = this.model.getCursorClip();
final PushDisplay display = (PushDisplay) this.surface.getDisplay();
final DisplayMessage message = display.createMessage();
final IChannelBank tb = this.model.getCurrentTrackBank();
final ITrack t0 = tb.getTrack(0);
final ITrack t1 = tb.getTrack(1);
final ITrack t2 = tb.getTrack(2);
final ITrack t3 = tb.getTrack(3);
final ITrack t4 = tb.getTrack(4);
final ITrack t5 = tb.getTrack(5);
final ITrack t6 = tb.getTrack(6);
final ITrack t7 = tb.getTrack(7);
message.addParameterElement("", false, t0.getName(), t0.getType(), t0.getColor(), t0.isSelected(), "Play Start", -1, this.formatMeasures(clip.getPlayStart(), 1), this.isKnobTouched[0], -1);
message.addParameterElement("", false, t1.getName(), t1.getType(), t1.getColor(), t1.isSelected(), "Play End", -1, this.formatMeasures(clip.getPlayEnd(), 1), this.isKnobTouched[1], -1);
message.addParameterElement("", false, t2.getName(), t2.getType(), t2.getColor(), t2.isSelected(), "Loop Start", -1, this.formatMeasures(clip.getLoopStart(), 1), this.isKnobTouched[2], -1);
message.addParameterElement("", false, t3.getName(), t3.getType(), t3.getColor(), t3.isSelected(), "Loop Lngth", -1, this.formatMeasures(clip.getLoopLength(), 0), this.isKnobTouched[3], -1);
message.addParameterElement("", false, t4.getName(), t4.getType(), t4.getColor(), t4.isSelected(), "Loop", -1, clip.isLoopEnabled() ? "On" : "Off", this.isKnobTouched[4], -1);
message.addParameterElement("", false, t5.getName(), t5.getType(), t5.getColor(), t5.isSelected(), "", -1, "", false, -1);
message.addParameterElement("", false, t6.getName(), t6.getType(), t6.getColor(), t6.isSelected(), "Shuffle", -1, clip.isShuffleEnabled() ? "On" : "Off", this.isKnobTouched[6], -1);
message.addParameterElement("Select color", false, t7.getName(), t7.getType(), t7.getColor(), t7.isSelected(), "Accent", -1, clip.getFormattedAccent(), this.isKnobTouched[7], -1);
display.send(message);
}
Aggregations