Search in sources :

Example 91 with ITrackBank

use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.

the class AbstractTrackMode method updateSoloMenu.

protected void updateSoloMenu() {
    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() ? "Solo" : "", Boolean.valueOf(t.isSolo()));
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 92 with ITrackBank

use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.

the class AbstractTrackMode method drawRow4.

protected void drawRow4(final ITextDisplay d) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> selTrack = tb.getSelectedItem();
    // Format track names
    final int selIndex = selTrack.isEmpty() ? -1 : selTrack.get().getIndex();
    for (int i = 0; i < 8; i++) {
        final boolean isSel = i == selIndex;
        final ITrack t = tb.getItem(i);
        String trackName = t.getName();
        if (t.doesExist() && t.isGroup())
            trackName = (t.isGroupExpanded() ? Push1Display.THREE_ROWS : Push1Display.FOLDER) + trackName;
        final String n = StringUtils.shortenAndFixASCII(trackName, isSel ? 7 : 8);
        d.setCell(3, i, isSel ? Push1Display.SELECT_ARROW + n : n);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 93 with ITrackBank

use of de.mossgrabers.framework.daw.data.bank.ITrackBank 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 ITrackBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getItem(index);
    if (this.surface.isPressed(ButtonID.STOP_CLIP)) {
        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.isActive(Modes.VOLUME))
                modeManager.setActive(Modes.TRACK);
            else
                modeManager.setActive(Modes.VOLUME);
            break;
        case 1:
            if (modeManager.isActive(Modes.PAN))
                modeManager.setActive(Modes.TRACK);
            else
                modeManager.setActive(Modes.PAN);
            break;
        case 2:
            if (modeManager.isActive(Modes.CROSSFADER))
                modeManager.setActive(Modes.TRACK);
            else
                modeManager.setActive(Modes.CROSSFADER);
            break;
        case 3:
            if (!this.model.isEffectTrackBankActive()) {
                config.setSendsAreToggled(!config.isSendsAreToggled());
                if (!modeManager.isActive(Modes.TRACK))
                    modeManager.setActive(Modes.get(Modes.SEND1, config.isSendsAreToggled() ? 4 : 0));
            }
            break;
        case 7:
            if (!this.model.isEffectTrackBankActive()) {
                if (this.lastSendIsAccessible())
                    this.handleSendEffect(config.isSendsAreToggled() ? 7 : 3);
                else
                    this.model.getTrackBank().selectParent();
            }
            break;
        default:
            this.handleSendEffect(index - (config.isSendsAreToggled() ? 0 : 4));
            break;
    }
    config.setDebugMode(modeManager.getActiveID());
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 94 with ITrackBank

use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.

the class SessionMode method updateDisplay1Clips.

private void updateDisplay1Clips(final ITextDisplay display) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final int numTracks = tb.getPageSize();
    final int numScenes = tb.getSceneBank().getPageSize();
    final boolean flipSession = this.surface.getConfiguration().isFlipSession();
    final int maxCols = flipSession ? numScenes : numTracks;
    int maxRows = flipSession ? numTracks : numScenes;
    if (this.rowDisplayMode != RowDisplayMode.ALL)
        maxRows = maxRows / 2;
    for (int col = 0; col < maxCols; col++) {
        for (int row = 0; row < maxRows; row++) {
            int x = flipSession ? row : col;
            int y = flipSession ? col : row;
            if (this.rowDisplayMode == RowDisplayMode.LOWER) {
                if (flipSession)
                    x += maxRows;
                else
                    y += maxRows;
            }
            final ITrack track = tb.getItem(x);
            final ISlot slot = track.getSlotBank().getItem(y);
            if (!slot.doesExist())
                continue;
            String name = slot.getName(8);
            if (track.isGroup()) {
                if (name.isEmpty())
                    name = "Scene " + (slot.getPosition() + 1);
            } else {
                // https://github.com/teotigraphix/Framework4Bitwig/issues/193
                if (name.isEmpty()) {
                    final ColorEx color = slot.getColor();
                    if (color.getRed() != 0 || color.getGreen() != 0 || color.getBlue() != 0)
                        name = "--------";
                }
            }
            if (slot.isSelected())
                name = Push1Display.SELECT_ARROW + name;
            else if (slot.isPlaying())
                name = ">" + name;
            else if (slot.isPlayingQueued() || slot.isRecordingQueued())
                name = ")" + name;
            else if (track.isRecArm() || slot.isRecording())
                name = "*" + name;
            else if (slot.hasContent())
                name = Push1Display.RIGHT_ARROW + name;
            else
                name = Push1Display.DEGREE + name;
            display.setCell(row, col, StringUtils.shortenAndFixASCII(name, 8));
        }
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ColorEx(de.mossgrabers.framework.controller.color.ColorEx) ISlot(de.mossgrabers.framework.daw.data.ISlot)

Example 95 with ITrackBank

use of de.mossgrabers.framework.daw.data.bank.ITrackBank in project DrivenByMoss by git-moss.

the class SessionMode method updateDisplay2Clips.

private void updateDisplay2Clips(final IGraphicDisplay display) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final int numTracks = tb.getPageSize();
    final int numScenes = tb.getSceneBank().getPageSize();
    final boolean flipSession = this.surface.getConfiguration().isFlipSession();
    final int maxCols = flipSession ? numScenes : numTracks;
    int maxRows = flipSession ? numTracks : numScenes;
    if (this.rowDisplayMode != RowDisplayMode.ALL)
        maxRows = maxRows / 2;
    for (int col = 0; col < maxCols; col++) {
        final List<Pair<ITrack, ISlot>> slots = new ArrayList<>(maxRows);
        for (int row = 0; row < maxRows; row++) {
            int x = flipSession ? row : col;
            int y = flipSession ? col : row;
            if (this.rowDisplayMode == RowDisplayMode.LOWER) {
                if (flipSession)
                    x += maxRows;
                else
                    y += maxRows;
            }
            final ITrack track = tb.getItem(x);
            slots.add(new Pair<>(track, track.getSlotBank().getItem(y)));
        }
        display.addSlotListElement(slots);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) ArrayList(java.util.ArrayList) Pair(de.mossgrabers.framework.utils.Pair)

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