Search in sources :

Example 81 with IChannelBank

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

the class ShiftView method onSelectTrack.

/**
 * {@inheritDoc}
 */
@Override
public void onSelectTrack(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    switch(index) {
        case 0:
            this.model.getCurrentTrackBank().scrollScenesPageUp();
            break;
        case 1:
            this.model.getCurrentTrackBank().scrollScenesPageDown();
            break;
        case 2:
            this.model.getCurrentTrackBank().scrollTracksPageUp();
            break;
        case 3:
            this.model.getCurrentTrackBank().scrollTracksPageDown();
            break;
        case 4:
            this.surface.getModeManager().setActiveMode(Modes.MODE_VOLUME);
            this.surface.getConfiguration().setFaderCtrl("Volume");
            this.surface.getDisplay().notify("Volume");
            break;
        case 5:
            this.surface.getModeManager().setActiveMode(Modes.MODE_PAN);
            this.surface.getConfiguration().setFaderCtrl("Pan");
            this.surface.getDisplay().notify("Pan");
            break;
        case 6:
            if (this.model.isEffectTrackBankActive())
                return;
            final ModeManager modeManager = this.surface.getModeManager();
            Integer mode = Integer.valueOf(modeManager.getActiveModeId().intValue() + 1);
            // Wrap
            if (!Modes.isSendMode(mode))
                mode = Modes.MODE_SEND1;
            // Check if Send channel exists
            final IChannelBank fxTrackBank = this.model.getEffectTrackBank();
            if (Modes.isSendMode(mode) && fxTrackBank != null && !fxTrackBank.getTrack(mode.intValue() - Modes.MODE_SEND1.intValue()).doesExist())
                mode = Modes.MODE_SEND1;
            modeManager.setActiveMode(mode);
            final String name = "Send " + (mode.intValue() - Modes.MODE_SEND1.intValue() + 1);
            this.surface.getConfiguration().setFaderCtrl(name);
            this.surface.getDisplay().notify(name);
            break;
        case 7:
            if (this.surface.getModeManager().isActiveMode(Modes.MODE_DEVICE)) {
                this.model.getBrowser().browseForPresets();
                final ViewManager viewManager = this.surface.getViewManager();
                final Integer previousViewId = viewManager.getPreviousViewId();
                viewManager.setActiveView(Views.VIEW_BROWSER);
                viewManager.setPreviousView(previousViewId);
            } else {
                this.surface.getModeManager().setActiveMode(Modes.MODE_DEVICE);
                this.surface.getConfiguration().setFaderCtrl("Device");
                this.surface.getDisplay().notify("Device");
            }
            break;
    }
}
Also used : IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 82 with IChannelBank

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

the class ShiftView method onNew.

private void onNew() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack t = tb.getSelectedTrack();
    if (t != null) {
        final ISlot[] slotIndexes = t.getSelectedSlots();
        final int slotIndex = slotIndexes.length == 0 ? 0 : slotIndexes[0].getIndex();
        for (int i = 0; i < 8; i++) {
            final int sIndex = (slotIndex + i) % 8;
            final ISlot s = t.getSlot(sIndex);
            if (s.hasContent())
                continue;
            this.model.createClip(s, this.surface.getConfiguration().getNewClipLength());
            if (slotIndex != sIndex)
                s.select();
            s.launch();
            this.model.getTransport().setLauncherOverdub(true);
            return;
        }
    }
    this.surface.getDisplay().notify("In the current selected grid view there is no empty slot. Please scroll down.");
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ISlot(de.mossgrabers.framework.daw.data.ISlot)

Example 83 with IChannelBank

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

the class MasterCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    this.model.toggleCurrentTrackBank();
    if (this.model.isEffectTrackBankActive()) {
        // No Sends on effect tracks
        final ModeManager modeManager = this.surface.getModeManager();
        final int mode = modeManager.getActiveModeId().intValue();
        if (mode >= Modes.MODE_SEND1.intValue() && mode <= Modes.MODE_SEND8.intValue())
            modeManager.setActiveMode(Modes.MODE_PAN);
    }
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack track = tb.getSelectedTrack();
    if (track == null)
        tb.getTrack(0).select();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 84 with IChannelBank

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

the class PlayView method updateArrows.

/**
 * {@inheritDoc}
 */
@Override
public void updateArrows() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack sel = tb.getSelectedTrack();
    this.canScrollLeft = sel != null && sel.getIndex() > 0 || tb.canScrollTracksUp();
    this.canScrollRight = sel != null && sel.getIndex() < 7 || tb.canScrollTracksDown();
    super.updateArrows();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank)

Example 85 with IChannelBank

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

the class LaunchpadCursorCommand method updateArrowStates.

/**
 * {@inheritDoc}
 */
@Override
protected void updateArrowStates() {
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY)) {
        final Scales scales = this.model.getScales();
        final int octave = scales.getOctave();
        this.canScrollUp = octave < 3;
        this.canScrollDown = octave > -3;
        final int scale = scales.getScale().ordinal();
        this.canScrollLeft = scale > 0;
        this.canScrollRight = scale < Scale.values().length - 1;
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DRUM)) {
        final int octave = this.model.getScales().getDrumOctave();
        this.canScrollUp = octave < 5;
        this.canScrollDown = octave > -3;
        this.canScrollLeft = this.model.getCursorClip().getEditPage() > 0;
        // TODO API extension required - We do not know the number of steps
        this.canScrollRight = true;
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DRUM64)) {
        final DrumView64 drumView64 = (DrumView64) viewManager.getView(Views.VIEW_DRUM64);
        final int octave = drumView64.getDrumOctave();
        this.canScrollUp = octave < 1;
        this.canScrollDown = octave > -2;
        this.canScrollLeft = false;
        this.canScrollRight = false;
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_SEQUENCER) || viewManager.isActiveView(Views.VIEW_RAINDROPS)) {
        final int octave = this.model.getScales().getOctave();
        this.canScrollUp = octave < Scales.OCTAVE_RANGE;
        this.canScrollDown = octave > -Scales.OCTAVE_RANGE;
        this.canScrollLeft = this.model.getCursorClip().getEditPage() > 0;
        // TODO API extension required - We do not know the number of steps
        this.canScrollRight = true;
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        this.canScrollUp = cursorDevice.canSelectNextFX();
        this.canScrollDown = cursorDevice.canSelectPreviousFX();
        this.canScrollLeft = cursorDevice.hasPreviousParameterPage();
        this.canScrollRight = cursorDevice.hasNextParameterPage();
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_BROWSER)) {
        final IBrowser browser = this.model.getBrowser();
        final int index = browser.getSelectedContentTypeIndex();
        this.canScrollUp = false;
        this.canScrollDown = false;
        this.canScrollLeft = index > 0;
        this.canScrollRight = index < browser.getContentTypeNames().length - 1;
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM4) || viewManager.isActiveView(Views.VIEW_DRUM8)) {
        this.canScrollUp = false;
        this.canScrollDown = false;
        this.canScrollLeft = false;
        this.canScrollRight = false;
        return;
    }
    // VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
    final ITrack sel = tb.getSelectedTrack();
    final int selIndex = sel != null ? sel.getIndex() : -1;
    this.canScrollLeft = selIndex > 0 || tb.canScrollTracksUp();
    this.canScrollRight = selIndex >= 0 && selIndex < 7 && tb.getTrack(selIndex + 1).doesExist() || tb.canScrollTracksDown();
    this.canScrollUp = tb.canScrollScenesUp();
    this.canScrollDown = tb.canScrollScenesDown();
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) Scales(de.mossgrabers.framework.scale.Scales) DrumView64(de.mossgrabers.launchpad.view.DrumView64) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

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