Search in sources :

Example 36 with ITrack

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);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 37 with ITrack

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;
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 38 with ITrack

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);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 39 with ITrack

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);
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 40 with ITrack

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);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ICursorClip(de.mossgrabers.framework.daw.ICursorClip) PushDisplay(de.mossgrabers.push.controller.PushDisplay) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Aggregations

ITrack (de.mossgrabers.framework.daw.data.ITrack)312 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)92 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)84 ISend (de.mossgrabers.framework.daw.data.ISend)40 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)25 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)19 ISlot (de.mossgrabers.framework.daw.data.ISlot)19 Display (de.mossgrabers.framework.controller.display.Display)18 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)18 ModeManager (de.mossgrabers.framework.mode.ModeManager)18 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 ViewManager (de.mossgrabers.framework.view.ViewManager)16 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)15 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)15 PushConfiguration (de.mossgrabers.push.PushConfiguration)14 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)12 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)11 PushDisplay (de.mossgrabers.push.controller.PushDisplay)11 ITransport (de.mossgrabers.framework.daw.ITransport)9 IParameter (de.mossgrabers.framework.daw.data.IParameter)9