Search in sources :

Example 41 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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 42 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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 43 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank 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)

Example 44 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.

the class SendMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final int sendIndex = this.getCurrentSendIndex();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(i);
        if (t.doesExist()) {
            final ISend send = t.getSend(sendIndex);
            d.setCell(0, i, send.getName());
            d.setCell(1, i, send.getDisplayedValue(8));
            d.setCell(2, i, send.getValue(), Format.FORMAT_VALUE);
        } else
            d.clearColumn(i);
    }
    d.done(0).done(1).done(2);
    this.drawRow4();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 45 with IChannelBank

use of de.mossgrabers.framework.daw.IChannelBank in project DrivenByMoss by git-moss.

the class SendMode method onValueKnobTouch.

/**
 * {@inheritDoc}
 */
@Override
public void onValueKnobTouch(final int index, final boolean isTouched) {
    final int sendIndex = this.getCurrentSendIndex();
    this.isKnobTouched[index] = isTouched;
    final ITrack t = this.model.getCurrentTrackBank().getTrack(index);
    final ISend send = t.getSend(sendIndex);
    if (isTouched) {
        if (this.surface.isDeletePressed()) {
            this.surface.setButtonConsumed(this.surface.getDeleteButtonId());
            send.resetValue();
            return;
        }
        final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
        if (t.doesExist())
            this.surface.getDisplay().notify("Send " + (fxTrackBank == null ? send.getName() : fxTrackBank.getTrack(sendIndex).getName()) + ": " + send.getValue());
    }
    send.touchValue(isTouched);
    this.checkStopAutomationOnKnobRelease(isTouched);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISend(de.mossgrabers.framework.daw.data.ISend)

Aggregations

IChannelBank (de.mossgrabers.framework.daw.IChannelBank)114 ITrack (de.mossgrabers.framework.daw.data.ITrack)92 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)22 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)20 ModeManager (de.mossgrabers.framework.mode.ModeManager)20 PushConfiguration (de.mossgrabers.push.PushConfiguration)19 Display (de.mossgrabers.framework.controller.display.Display)18 ISend (de.mossgrabers.framework.daw.data.ISend)11 ViewManager (de.mossgrabers.framework.view.ViewManager)10 PushDisplay (de.mossgrabers.push.controller.PushDisplay)10 IChannel (de.mossgrabers.framework.daw.data.IChannel)9 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ISlot (de.mossgrabers.framework.daw.data.ISlot)7 IValueChanger (de.mossgrabers.framework.controller.IValueChanger)5 View (de.mossgrabers.framework.view.View)5 DisplayMessage (de.mossgrabers.push.controller.DisplayMessage)5 ITransport (de.mossgrabers.framework.daw.ITransport)4 IMidiOutput (de.mossgrabers.framework.daw.midi.IMidiOutput)4 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)3 PadGrid (de.mossgrabers.framework.controller.grid.PadGrid)3