Search in sources :

Example 1 with DrumView64

use of de.mossgrabers.launchpad.view.DrumView64 in project DrivenByMoss by git-moss.

the class LaunchpadControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final LaunchpadControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.registerView(Views.VIEW_BROWSER, new BrowserView(surface, this.model));
    viewManager.registerView(Views.VIEW_DEVICE, new DeviceView(surface, this.model));
    viewManager.registerView(Views.VIEW_DRUM, new DrumView(surface, this.model));
    viewManager.registerView(Views.VIEW_DRUM4, new DrumView4(surface, this.model));
    viewManager.registerView(Views.VIEW_DRUM8, new DrumView8(surface, this.model));
    viewManager.registerView(Views.VIEW_PAN, new PanView(surface, this.model));
    viewManager.registerView(Views.VIEW_DRUM64, new DrumView64(surface, this.model));
    viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
    viewManager.registerView(Views.VIEW_RAINDROPS, new RaindropsView(surface, this.model));
    viewManager.registerView(Views.VIEW_SENDS, new SendsView(surface, this.model));
    viewManager.registerView(Views.VIEW_SEQUENCER, new SequencerView(surface, this.model));
    viewManager.registerView(Views.VIEW_SESSION, new SessionView(surface, this.model));
    viewManager.registerView(Views.VIEW_VOLUME, new VolumeView(surface, this.model));
    viewManager.registerView(Views.VIEW_SHIFT, new ShiftView(surface, this.model));
}
Also used : RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) SendsView(de.mossgrabers.launchpad.view.SendsView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.launchpad.view.SessionView) PanView(de.mossgrabers.launchpad.view.PanView) DrumView64(de.mossgrabers.launchpad.view.DrumView64) LaunchpadControlSurface(de.mossgrabers.launchpad.controller.LaunchpadControlSurface) DrumView(de.mossgrabers.launchpad.view.DrumView) PlayView(de.mossgrabers.launchpad.view.PlayView) DrumView4(de.mossgrabers.launchpad.view.DrumView4) SequencerView(de.mossgrabers.launchpad.view.SequencerView) DrumView8(de.mossgrabers.launchpad.view.DrumView8) ShiftView(de.mossgrabers.launchpad.view.ShiftView) VolumeView(de.mossgrabers.launchpad.view.VolumeView) DeviceView(de.mossgrabers.launchpad.view.DeviceView) BrowserView(de.mossgrabers.launchpad.view.BrowserView)

Example 2 with DrumView64

use of de.mossgrabers.launchpad.view.DrumView64 in project DrivenByMoss by git-moss.

the class LaunchpadCursorCommand method scrollUp.

/**
 * {@inheritDoc}
 */
@Override
protected void scrollUp() {
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY)) {
        ((PlayView) viewManager.getView(Views.VIEW_PLAY)).onOctaveUp(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DRUM)) {
        ((DrumView) viewManager.getView(Views.VIEW_DRUM)).onOctaveUp(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DRUM64)) {
        ((DrumView64) viewManager.getView(Views.VIEW_DRUM64)).onOctaveUp(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_SEQUENCER)) {
        ((SequencerView) viewManager.getView(Views.VIEW_SEQUENCER)).onOctaveUp(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_RAINDROPS)) {
        ((RaindropsView) viewManager.getView(Views.VIEW_RAINDROPS)).onOctaveUp(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
        this.model.getCursorDevice().selectNext();
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_BROWSER) || viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM4) || viewManager.isActiveView(Views.VIEW_DRUM8))
        return;
    // VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
    super.scrollUp();
// TODO could be used for layer navigation
// VIEW_DEVICE
}
Also used : AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) ViewManager(de.mossgrabers.framework.view.ViewManager) DrumView64(de.mossgrabers.launchpad.view.DrumView64) DrumView(de.mossgrabers.launchpad.view.DrumView) PlayView(de.mossgrabers.launchpad.view.PlayView)

Example 3 with DrumView64

use of de.mossgrabers.launchpad.view.DrumView64 in project DrivenByMoss by git-moss.

the class LaunchpadCursorCommand method scrollDown.

/**
 * {@inheritDoc}
 */
@Override
protected void scrollDown() {
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY)) {
        ((PlayView) viewManager.getView(Views.VIEW_PLAY)).onOctaveDown(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DRUM)) {
        ((DrumView) viewManager.getView(Views.VIEW_DRUM)).onOctaveDown(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DRUM64)) {
        ((DrumView64) viewManager.getView(Views.VIEW_DRUM64)).onOctaveDown(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_SEQUENCER)) {
        ((SequencerView) viewManager.getView(Views.VIEW_SEQUENCER)).onOctaveDown(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_RAINDROPS)) {
        ((RaindropsView) viewManager.getView(Views.VIEW_RAINDROPS)).onOctaveDown(ButtonEvent.DOWN);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
        this.model.getCursorDevice().selectPrevious();
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_BROWSER) || viewManager.isActiveView(Views.VIEW_SHIFT) || viewManager.isActiveView(Views.VIEW_DRUM4) || viewManager.isActiveView(Views.VIEW_DRUM8))
        return;
    // VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
    super.scrollDown();
// TODO could be used for layer navigation
// VIEW_DEVICE
}
Also used : AbstractSequencerView(de.mossgrabers.framework.view.AbstractSequencerView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) ViewManager(de.mossgrabers.framework.view.ViewManager) DrumView64(de.mossgrabers.launchpad.view.DrumView64) DrumView(de.mossgrabers.launchpad.view.DrumView) PlayView(de.mossgrabers.launchpad.view.PlayView)

Example 4 with DrumView64

use of de.mossgrabers.launchpad.view.DrumView64 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

ViewManager (de.mossgrabers.framework.view.ViewManager)4 DrumView64 (de.mossgrabers.launchpad.view.DrumView64)4 DrumView (de.mossgrabers.launchpad.view.DrumView)3 PlayView (de.mossgrabers.launchpad.view.PlayView)3 RaindropsView (de.mossgrabers.launchpad.view.RaindropsView)3 SequencerView (de.mossgrabers.launchpad.view.SequencerView)3 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)2 IBrowser (de.mossgrabers.framework.daw.IBrowser)1 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)1 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)1 ITrack (de.mossgrabers.framework.daw.data.ITrack)1 Scales (de.mossgrabers.framework.scale.Scales)1 LaunchpadControlSurface (de.mossgrabers.launchpad.controller.LaunchpadControlSurface)1 BrowserView (de.mossgrabers.launchpad.view.BrowserView)1 DeviceView (de.mossgrabers.launchpad.view.DeviceView)1 DrumView4 (de.mossgrabers.launchpad.view.DrumView4)1 DrumView8 (de.mossgrabers.launchpad.view.DrumView8)1 PanView (de.mossgrabers.launchpad.view.PanView)1 SendsView (de.mossgrabers.launchpad.view.SendsView)1 SessionView (de.mossgrabers.launchpad.view.SessionView)1