Search in sources :

Example 96 with ITrack

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

the class PolySequencerView method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN || !this.isActive())
        return;
    final ITrack cursorTrack = this.model.getCursorTrack();
    final INoteClip clip = this.getClip();
    switch(buttonID) {
        case ARROW_LEFT:
            if (this.surface.isPressed(ButtonID.ALT))
                this.setResolutionIndex(this.selectedResolutionIndex - 1);
            else {
                clip.scrollStepsPageBackwards();
                this.mvHelper.notifyEditPage(clip);
            }
            break;
        case ARROW_RIGHT:
            if (this.surface.isPressed(ButtonID.ALT))
                this.setResolutionIndex(this.selectedResolutionIndex + 1);
            else {
                clip.scrollStepsPageForward();
                this.mvHelper.notifyEditPage(clip);
            }
            break;
        case SCENE1:
            cursorTrack.stop();
            break;
        case SCENE2:
            cursorTrack.toggleMute();
            break;
        case SCENE3:
            cursorTrack.toggleSolo();
            break;
        case SCENE4:
            cursorTrack.toggleRecArm();
            break;
        default:
            // Not used
            break;
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) INoteClip(de.mossgrabers.framework.daw.INoteClip)

Example 97 with ITrack

use of de.mossgrabers.framework.daw.data.ITrack 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)

Example 98 with ITrack

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

the class SendsView method setupFader.

/**
 * {@inheritDoc}
 */
@Override
public void setupFader(final int index) {
    final ITrack track = this.model.getCurrentTrackBank().getItem(index);
    final int color = this.colorManager.getColorIndex(DAWColor.getColorIndex(track.getColor()));
    this.surface.setupFader(index, color, false);
    final ISend send = track.getSendBank().getItem(this.selectedSend);
    this.surface.setFaderValue(index, send.getValue());
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 99 with ITrack

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

the class MixView method getButtonColor.

/**
 * {@inheritDoc}
 */
@Override
public int getButtonColor(final ButtonID buttonID) {
    final int index = 7 - (buttonID.ordinal() - ButtonID.SCENE1.ordinal());
    int color = 0;
    int value = 0;
    final Optional<ITrack> track = this.model.getCurrentTrackBank().getSelectedItem();
    if (track.isPresent()) {
        switch(this.faderMode) {
            default:
            case VOLUME:
                value = track.get().getVolume();
                color = LaunchpadColorManager.LAUNCHPAD_COLOR_CYAN;
                break;
            case PAN:
                value = track.get().getPan();
                color = LaunchpadColorManager.LAUNCHPAD_COLOR_SKY_HI;
                break;
            case SEND1:
                final ISend send1 = track.get().getSendBank().getItem(0);
                value = send1.doesExist() ? send1.getValue() : 0;
                color = LaunchpadColorManager.LAUNCHPAD_COLOR_ORCHID_HI;
                break;
            case SEND2:
                final ISend send2 = track.get().getSendBank().getItem(1);
                value = send2.doesExist() ? send2.getValue() : 0;
                color = LaunchpadColorManager.LAUNCHPAD_COLOR_LIME_HI;
                break;
        }
    }
    this.fader.setup(color, this.faderMode == FaderMode.PAN);
    this.fader.setValue(value);
    return this.fader.getColorState(index);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend)

Example 100 with ITrack

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

the class SelectNoteViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.UP)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActive(Views.CONTROL)) {
        viewManager.restore();
        this.surface.getDisplay().notify(viewManager.getActive().getName());
        return;
    }
    Views viewID = viewManager.getActiveID();
    if (Views.isNoteView(viewID) || Views.isSequencerView(viewID)) {
        viewManager.setActive(Views.CONTROL);
        this.surface.getDisplay().notify("Note / sequencer mode selection");
        return;
    }
    final ITrack cursorTrack = this.model.getCursorTrack();
    if (!cursorTrack.doesExist()) {
        viewManager.setActive(Views.SESSION);
        this.surface.getDisplay().notify("Session");
        return;
    }
    viewID = viewManager.getPreferredView(cursorTrack.getPosition());
    if (viewID == null)
        viewID = Views.PLAY;
    viewManager.setActive(viewID);
    this.surface.getDisplay().notify(viewManager.get(viewID).getName());
}
Also used : Views(de.mossgrabers.framework.view.Views) ITrack(de.mossgrabers.framework.daw.data.ITrack) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Aggregations

ITrack (de.mossgrabers.framework.daw.data.ITrack)312 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)92 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)84 ISend (de.mossgrabers.framework.daw.data.ISend)40 ISendBank (de.mossgrabers.framework.daw.data.bank.ISendBank)25 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)19 ISlot (de.mossgrabers.framework.daw.data.ISlot)19 Display (de.mossgrabers.framework.controller.display.Display)18 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)18 ModeManager (de.mossgrabers.framework.mode.ModeManager)18 ITextDisplay (de.mossgrabers.framework.controller.display.ITextDisplay)16 ViewManager (de.mossgrabers.framework.view.ViewManager)16 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)15 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)15 PushConfiguration (de.mossgrabers.push.PushConfiguration)14 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)12 IPadGrid (de.mossgrabers.framework.controller.grid.IPadGrid)11 PushDisplay (de.mossgrabers.push.controller.PushDisplay)11 ITransport (de.mossgrabers.framework.daw.ITransport)9 IParameter (de.mossgrabers.framework.daw.data.IParameter)9