Search in sources :

Example 96 with IChannelBank

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

the class AbstractTrackMode method onSecondRow.

/**
 * {@inheritDoc}
 */
@Override
public void onSecondRow(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getTrack(index);
    if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP)) {
        track.stop();
        return;
    }
    final PushConfiguration config = this.surface.getConfiguration();
    if (!this.isPush2 || config.isMuteLongPressed() || config.isSoloLongPressed() || config.isMuteSoloLocked()) {
        if (config.isMuteState())
            track.toggleMute();
        else
            track.toggleSolo();
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    switch(index) {
        case 0:
            if (modeManager.isActiveMode(Modes.MODE_VOLUME))
                modeManager.setActiveMode(Modes.MODE_TRACK);
            else
                modeManager.setActiveMode(Modes.MODE_VOLUME);
            break;
        case 1:
            if (modeManager.isActiveMode(Modes.MODE_PAN))
                modeManager.setActiveMode(Modes.MODE_TRACK);
            else
                modeManager.setActiveMode(Modes.MODE_PAN);
            break;
        case 2:
            if (config.isDisplayCrossfader()) {
                if (modeManager.isActiveMode(Modes.MODE_CROSSFADER))
                    modeManager.setActiveMode(Modes.MODE_TRACK);
                else
                    modeManager.setActiveMode(Modes.MODE_CROSSFADER);
            }
            break;
        case 3:
            if (!this.model.isEffectTrackBankActive()) {
                config.setSendsAreToggled(!config.isSendsAreToggled());
                if (!modeManager.isActiveMode(Modes.MODE_TRACK))
                    modeManager.setActiveMode(Integer.valueOf(Modes.MODE_SEND1.intValue() + (config.isSendsAreToggled() ? 4 : 0)));
            }
            break;
        case 7:
            if (!this.model.isEffectTrackBankActive())
                this.model.getTrackBank().selectParent();
            break;
        default:
            final int sendIndex = index - (config.isSendsAreToggled() ? 0 : 4);
            if (tb.canEditSend(sendIndex)) {
                final Integer si = Integer.valueOf(Modes.MODE_SEND1.intValue() + sendIndex);
                modeManager.setActiveMode(modeManager.isActiveMode(si) ? Modes.MODE_TRACK : si);
            }
            break;
    }
    config.setDebugMode(modeManager.getActiveModeId());
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 97 with IChannelBank

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

the class CrossfaderMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final int upperBound = this.model.getValueChanger().getUpperBound();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(i);
        d.setCell(0, i, t.doesExist() ? "Crossfdr" : "");
        if (t.doesExist()) {
            final boolean isA = "A".equals(t.getCrossfadeMode());
            d.setCell(1, i, isA ? "A" : "B".equals(t.getCrossfadeMode()) ? "       B" : "   <> ");
            d.setCell(2, i, isA ? 0 : "B".equals(t.getCrossfadeMode()) ? upperBound : upperBound / 2, Format.FORMAT_PAN);
        } else {
            d.clearCell(1, i);
            d.clearCell(2, 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) Display(de.mossgrabers.framework.controller.display.Display)

Example 98 with IChannelBank

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

the class PanMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(i);
        d.setCell(0, i, t.doesExist() ? "Pan" : "").setCell(1, i, t.getPanStr(8));
        if (t.doesExist())
            d.setCell(2, i, t.getPan(), Format.FORMAT_PAN);
        else
            d.clearCell(2, 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) Display(de.mossgrabers.framework.controller.display.Display)

Example 99 with IChannelBank

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

the class SendMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    this.updateTrackMenu();
    final int sendIndex = this.getCurrentSendIndex();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
    final PushConfiguration config = this.surface.getConfiguration();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    final int sendOffset = config.isSendsAreToggled() ? 4 : 0;
    for (int i = 0; i < 8; i++) {
        final ITrack t = tb.getTrack(i);
        // The menu item
        String topMenu;
        boolean topMenuSelected;
        if (this.surface.isPressed(PushControlSurface.PUSH_BUTTON_CLIP_STOP)) {
            topMenu = t.doesExist() ? "Stop Clip" : "";
            topMenuSelected = t.isPlaying();
        } else if (config.isMuteLongPressed() || config.isMuteSoloLocked() && config.isMuteState()) {
            topMenu = t.doesExist() ? "Mute" : "";
            topMenuSelected = t.isMute();
        } else if (config.isSoloLongPressed() || config.isMuteSoloLocked() && config.isSoloState()) {
            topMenu = t.doesExist() ? "Solo" : "";
            topMenuSelected = t.isSolo();
        } else {
            topMenu = this.menu[i];
            topMenuSelected = i > 3 && i - 4 + sendOffset == sendIndex || i == 7 && tb instanceof ITrackBank && ((ITrackBank) tb).hasParent();
        }
        final IValueChanger valueChanger = this.model.getValueChanger();
        final String[] sendName = new String[4];
        final String[] valueStr = new String[4];
        final int[] value = new int[4];
        final int[] modulatedValue = new int[4];
        final boolean[] selected = new boolean[4];
        for (int j = 0; j < 4; j++) {
            final int sendPos = sendOffset + j;
            final ISend send = t.getSend(sendPos);
            sendName[j] = fxTrackBank == null ? send.getName() : fxTrackBank.getTrack(sendPos).getName();
            valueStr[j] = send != null && sendIndex == sendPos && this.isKnobTouched[i] ? send.getDisplayedValue(8) : "";
            value[j] = valueChanger.toDisplayValue(send != null ? send.getValue() : -1);
            modulatedValue[j] = valueChanger.toDisplayValue(send != null ? send.getModulatedValue() : -1);
            selected[j] = sendIndex == sendPos;
        }
        message.addSendsElement(topMenu, topMenuSelected, t.doesExist() ? t.getName() : "", t.getType(), t.getColor(), t.isSelected(), sendName, valueStr, value, modulatedValue, selected, false);
    }
    display.send(message);
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IValueChanger(de.mossgrabers.framework.controller.IValueChanger) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) PushDisplay(de.mossgrabers.push.controller.PushDisplay) ISend(de.mossgrabers.framework.daw.data.ISend) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage)

Example 100 with IChannelBank

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

the class TrackDetailsMode method getSelectedTrack.

private ITrack getSelectedTrack() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack t = tb.getSelectedTrack();
    if (t != null)
        return t;
    final IMasterTrack master = this.model.getMasterTrack();
    return master.isSelected() ? master : null;
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack)

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