Search in sources :

Example 76 with ITrackBank

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

the class MixView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final IPadGrid padGrid = this.surface.getPadGrid();
    final ITrackBank tb = this.model.getCurrentTrackBank();
    for (int i = 0; i < tb.getPageSize(); i++) {
        final ITrack track = tb.getItem(i);
        if (track.doesExist()) {
            // Select
            final int colorIndex = this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor()));
            if (track.isSelected())
                padGrid.lightEx(i, 0, colorIndex, FireColorManager.FIRE_COLOR_WHITE, false);
            else
                padGrid.lightEx(i, 0, colorIndex);
            // Mute
            padGrid.lightEx(i, 1, track.isMute() ? FireColorManager.FIRE_COLOR_ORANGE : FireColorManager.FIRE_COLOR_DARKER_ORANGE);
            // Solo
            padGrid.lightEx(i, 2, track.isSolo() ? FireColorManager.FIRE_COLOR_YELLOW : FireColorManager.FIRE_COLOR_DARKER_YELLOW);
            // Record Arm
            padGrid.lightEx(i, 3, track.isRecArm() ? FireColorManager.FIRE_COLOR_RED : FireColorManager.FIRE_COLOR_DARKER_RED);
        } else {
            padGrid.lightEx(i, 3, FireColorManager.FIRE_COLOR_BLACK);
            padGrid.lightEx(i, 2, FireColorManager.FIRE_COLOR_BLACK);
            padGrid.lightEx(i, 1, FireColorManager.FIRE_COLOR_BLACK);
            padGrid.lightEx(i, 0, FireColorManager.FIRE_COLOR_BLACK);
        }
    }
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 77 with ITrackBank

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

the class FxTrackHandler method getTrack.

private Optional<ITrack> getTrack(final int trackIndex) {
    final ITrackBank tb = this.model.getEffectTrackBank();
    if (trackIndex < 0)
        return tb.getSelectedItem();
    final ITrack track = tb.getItem(trackIndex);
    return track.doesExist() ? Optional.of(track) : Optional.empty();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 78 with ITrackBank

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

the class TrackView method onGridNote.

/**
 * {@inheritDoc}
 */
@Override
public void onGridNote(final int note, final int velocity) {
    if (velocity == 0)
        return;
    final ITrackBank tb = this.model.getCurrentTrackBank();
    int track;
    final Optional<ITrack> selectedTrack = tb.getSelectedItem();
    int index;
    switch(note - 36) {
        // Toggle Activate
        case 0:
            if (selectedTrack.isPresent())
                selectedTrack.get().toggleIsActivated();
            break;
        // Track left
        case 1:
            index = selectedTrack.isEmpty() ? 0 : selectedTrack.get().getIndex() - 1;
            if (index == -1 || this.surface.isShiftPressed())
                tb.selectPreviousPage();
            else
                this.selectTrack(index);
            break;
        // Track right
        case 2:
            index = selectedTrack.isEmpty() ? 0 : selectedTrack.get().getIndex() + 1;
            if (index == 8 || this.surface.isShiftPressed())
                tb.selectNextPage();
            else
                this.selectTrack(index);
            break;
        // Move down
        case 3:
            if (selectedTrack.isPresent())
                selectedTrack.get().enter();
            break;
        // Move up
        case 4:
            tb.selectParent();
            break;
        // Unused
        case 5:
            break;
        // Track Page down
        case 6:
            tb.selectPreviousPage();
            break;
        // Track Page up
        case 7:
            tb.selectNextPage();
            break;
        default:
            track = note - 36 - 8;
            this.selectTrack(track);
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 79 with ITrackBank

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

the class TrackView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int i = 0; i < 8; i++) padGrid.light(44 + i, tb.getItem(i).isSelected() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE : BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    final Optional<ITrack> sel = tb.getSelectedItem();
    padGrid.light(36, sel.isPresent() && sel.get().isActivated() ? BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED : BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(37, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(38, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(39, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(40, BeatstepColorManager.BEATSTEP_BUTTON_STATE_RED);
    padGrid.light(41, BeatstepColorManager.BEATSTEP_BUTTON_STATE_OFF);
    padGrid.light(42, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
    padGrid.light(43, BeatstepColorManager.BEATSTEP_BUTTON_STATE_BLUE);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 80 with ITrackBank

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

the class StopClipCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ITrackBank currentTrackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> track = this.index == -1 ? currentTrackBank.getSelectedItem() : Optional.of(currentTrackBank.getItem(this.index));
    if (track.isPresent())
        track.get().returnToArrangement();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

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