Search in sources :

Example 6 with ITrackBank

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

the class FxTrackHandler method scrollTrackLeft.

private void scrollTrackLeft(final boolean switchBank) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> sel = tb.getSelectedItem();
    final int index = sel.isEmpty() ? 0 : sel.get().getIndex() - 1;
    if (index == -1 || switchBank) {
        tb.selectPreviousPage();
        return;
    }
    tb.getItem(index).select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 7 with ITrackBank

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

the class FxTrackHandler method scrollTrackRight.

private void scrollTrackRight(final boolean switchBank) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> sel = tb.getSelectedItem();
    final int index = sel.isEmpty() ? 0 : sel.get().getIndex() + 1;
    if (index == 8 || switchBank) {
        tb.selectNextPage();
        return;
    }
    tb.getItem(index).select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 8 with ITrackBank

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

the class TrackHandler method scrollTrackLeft.

private void scrollTrackLeft(final boolean switchBank) {
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> sel = tb.getSelectedItem();
    final int index = sel.isEmpty() ? 0 : sel.get().getIndex() - 1;
    if (index == -1 || switchBank) {
        tb.selectPreviousPage();
        return;
    }
    tb.getItem(index).select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank)

Example 9 with ITrackBank

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

the class FireTrackMixerMode method updateDisplay.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay() {
    this.updateMode();
    final IGraphicDisplay display = this.surface.getGraphicsDisplay();
    final ITrackBank trackBank = this.model.getCurrentTrackBank();
    final Optional<ITrack> trackOptional = trackBank.getSelectedItem();
    String label = "None";
    if (trackOptional.isPresent()) {
        final ITrack track = trackOptional.get();
        label = track.getPosition() + 1 + ": " + track.getName(9);
    }
    final int size = trackBank.getPageSize();
    final boolean[] selected = new boolean[size];
    final int[] values = new int[size];
    final boolean isMode = this.isAnyKnobTouched() || !this.model.getTransport().isPlaying();
    if (isMode) {
        switch(this.selectedParameter) {
            case VOLUME:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getVolume();
                }
                break;
            case PAN:
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    values[i] = channel.getPan();
                }
                break;
            case SEND1:
            case SEND2:
            case SEND3:
            case SEND4:
            case SEND5:
            case SEND6:
                final int sendIndex = this.selectedParameter.ordinal() - Modes.SEND1.ordinal();
                for (int i = 0; i < size; i++) {
                    final IChannel channel = trackBank.getItem(i);
                    selected[i] = channel.isSelected();
                    final ISendBank sendBank = channel.getSendBank();
                    if (sendBank != null) {
                        final ISend send = sendBank.getItem(sendIndex);
                        if (send.doesExist())
                            values[i] = send.getValue();
                    }
                }
                break;
            default:
                // Not used
                break;
        }
    } else {
        for (int i = 0; i < size; i++) {
            final IChannel channel = trackBank.getItem(i);
            selected[i] = channel.isSelected();
            values[i] = channel.getVu();
        }
    }
    display.addElement(new TitleChannelsComponent(label, selected, values, this.selectedParameter == Modes.PAN && isMode));
    display.send();
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.data.bank.ITrackBank) IGraphicDisplay(de.mossgrabers.framework.controller.display.IGraphicDisplay) TitleChannelsComponent(de.mossgrabers.controller.akai.fire.graphics.canvas.component.TitleChannelsComponent) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank)

Example 10 with ITrackBank

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

the class TrackView method onKnob.

/**
 * {@inheritDoc}
 */
@Override
public void onKnob(final int index, final int value, final boolean isTurnedRight) {
    if (index < 12) {
        this.extensions.onTrackKnob(index, value, isTurnedRight);
        return;
    }
    final ITrackBank tb = this.model.getCurrentTrackBank();
    final Optional<ITrack> selectedTrack = tb.getSelectedItem();
    if (selectedTrack.isEmpty())
        return;
    switch(index) {
        // Send 5 - 6
        case 12:
        case 13:
            if (!this.model.isEffectTrackBankActive())
                selectedTrack.get().getSendBank().getItem(index - 8).changeValue(value);
            break;
        case 14:
            // Not used
            break;
        // Crossfader
        case 15:
            this.model.getTransport().changeCrossfade(value);
            break;
        default:
            // Not used
            break;
    }
}
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