Search in sources :

Example 46 with ITrackBank

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));
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 47 with ITrackBank

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

Example 48 with ITrackBank

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

Example 49 with ITrackBank

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

Example 50 with ITrackBank

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);
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Aggregations

ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)121 ITrack (de.mossgrabers.framework.daw.data.ITrack)85 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)17 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 Modes (de.mossgrabers.framework.mode.Modes)15 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)10 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)10 ISend (de.mossgrabers.framework.daw.data.ISend)10 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)8 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)7 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)7 ICursorTrack (de.mossgrabers.framework.daw.data.ICursorTrack)6 IValueChanger (de.mossgrabers.framework.controller.valuechanger.IValueChanger)5 ITransport (de.mossgrabers.framework.daw.ITransport)5 IParameterBank (de.mossgrabers.framework.daw.data.bank.IParameterBank)5 ISceneBank (de.mossgrabers.framework.daw.data.bank.ISceneBank)5 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)4 ColorEx (de.mossgrabers.framework.controller.color.ColorEx)4 Kontrol1Display (de.mossgrabers.controller.ni.kontrol.mki.controller.Kontrol1Display)3 IHost (de.mossgrabers.framework.daw.IHost)3