Search in sources :

Example 41 with ICursorDevice

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

the class DeviceLeftCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannel layer = cd.getSelectedLayerOrDrumPad();
    if (!cd.hasLayers() || layer == null)
        cd.selectPrevious();
    else
        cd.selectLayer(layer.getIndex() == 0 ? 0 : layer.getIndex() - 1);
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 42 with ICursorDevice

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

the class DeviceRightCommand method executeShifted.

/**
 * {@inheritDoc}
 */
@Override
public void executeShifted(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    // Enter layer
    final ICursorDevice cd = this.model.getCursorDevice();
    if (!cd.hasLayers())
        return;
    final IChannel layer = cd.getSelectedLayerOrDrumPad();
    if (layer == null)
        cd.selectLayerOrDrumPad(0);
    else {
        final IChannel dl = cd.getSelectedLayer();
        if (dl != null) {
            final int index = dl.getIndex();
            cd.enterLayer(index);
            cd.selectFirstDeviceInLayer(index);
        }
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 43 with ICursorDevice

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

the class DeviceRightCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ICursorDevice cd = this.model.getCursorDevice();
    final IChannel sel = cd.getSelectedLayer();
    if (!cd.hasLayers() || sel == null)
        cd.selectNext();
    else {
        final int index = sel.getIndex() + 1;
        cd.selectLayer(index > 7 ? 7 : index);
    }
}
Also used : IChannel(de.mossgrabers.framework.daw.data.IChannel) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 44 with ICursorDevice

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

Example 45 with ICursorDevice

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

the class LaunchpadCursorCommand method scrollRight.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("rawtypes")
@Override
protected void scrollRight() {
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY)) {
        final Scales scales = this.model.getScales();
        scales.nextScale();
        final String name = scales.getScale().getName();
        this.surface.getConfiguration().setScale(name);
        this.surface.getDisplay().notify(name);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        cursorDevice.nextParameterPage();
        this.surface.getDisplay().notify(cursorDevice.getSelectedParameterPageName());
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_BROWSER)) {
        this.model.getBrowser().nextContentType();
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM64))
        return;
    // VIEW_SEQUENCER, VIEW_RAINDROPS, VIEW_DRUM, VIEW_DRUM4, VIEW_DRUM8
    final View activeView = viewManager.getActiveView();
    if (activeView instanceof AbstractSequencerView) {
        ((AbstractSequencerView) activeView).onRight(ButtonEvent.DOWN);
        return;
    }
    // VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
    this.scrollTracksRight();
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) Scales(de.mossgrabers.framework.scale.Scales) View(de.mossgrabers.framework.view.View) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) PlayView(de.mossgrabers.launchpad.view.PlayView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) DrumView(de.mossgrabers.launchpad.view.DrumView) AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Aggregations

ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)72 IChannel (de.mossgrabers.framework.daw.data.IChannel)25 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)22 ITrack (de.mossgrabers.framework.daw.data.ITrack)19 Display (de.mossgrabers.framework.controller.display.Display)10 ModeManager (de.mossgrabers.framework.mode.ModeManager)9 View (de.mossgrabers.framework.view.View)8 ViewManager (de.mossgrabers.framework.view.ViewManager)8 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)7 IParameter (de.mossgrabers.framework.daw.data.IParameter)6 ITransport (de.mossgrabers.framework.daw.ITransport)5 PushConfiguration (de.mossgrabers.push.PushConfiguration)5 ICursorClip (de.mossgrabers.framework.daw.ICursorClip)4 IMasterTrack (de.mossgrabers.framework.daw.data.IMasterTrack)4 SceneView (de.mossgrabers.framework.view.SceneView)4 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)3 IBrowser (de.mossgrabers.framework.daw.IBrowser)3 Scales (de.mossgrabers.framework.scale.Scales)3 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)3 DrumView (de.mossgrabers.launchpad.view.DrumView)3