Search in sources :

Example 16 with ViewManager

use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.

the class AbstractTrackCommand method onFaderModeButton.

protected void onFaderModeButton(final ButtonEvent event, final Integer view, final String notification) {
    final ViewManager viewManager = this.surface.getViewManager();
    switch(event) {
        case DOWN:
            if (viewManager.isActiveView(view)) {
                viewManager.restoreView();
                return;
            }
            this.temporaryView = false;
            this.surface.getModeManager().setActiveMode(null);
            viewManager.setActiveView(view);
            this.surface.getDisplay().notify(notification);
            break;
        case LONG:
            this.temporaryView = true;
            break;
        case UP:
            if (this.temporaryView)
                viewManager.restoreView();
            break;
    }
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 17 with ViewManager

use of de.mossgrabers.framework.view.ViewManager 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 18 with ViewManager

use of de.mossgrabers.framework.view.ViewManager 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 19 with ViewManager

use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.

the class SelectNoteViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    final IChannelBank tb = this.model.getCurrentTrackBank();
    final ITrack sel = tb.getSelectedTrack();
    if (sel == null) {
        viewManager.setActiveView(Views.VIEW_SESSION);
        return;
    }
    final boolean isShifted = this.surface.isShiftPressed();
    if (Views.isNoteView(isShifted ? viewManager.getPreviousViewId() : viewManager.getActiveViewId())) {
        if (isShifted)
            this.seqSelect.executeNormal(event);
        else
            this.playSelect.executeNormal(event);
    } else {
        final Integer viewID = viewManager.getPreferredView(sel.getPosition());
        if (viewID == null)
            this.seqSelect.executeNormal(event);
        else
            viewManager.setActiveView(viewID);
    }
    viewManager.setPreferredView(sel.getPosition(), viewManager.getActiveViewId());
    this.surface.getDisplay().notify(viewManager.getActiveView().getName());
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 20 with ViewManager

use of de.mossgrabers.framework.view.ViewManager in project DrivenByMoss by git-moss.

the class SelectSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_SESSION)) {
        final Configuration configuration = this.surface.getConfiguration();
        configuration.setFlipSession(!configuration.isFlipSession());
    } else
        viewManager.setActiveView(Views.VIEW_SESSION);
}
Also used : Configuration(de.mossgrabers.framework.configuration.Configuration) LaunchpadConfiguration(de.mossgrabers.launchpad.LaunchpadConfiguration) ViewManager(de.mossgrabers.framework.view.ViewManager)

Aggregations

ViewManager (de.mossgrabers.framework.view.ViewManager)64 ITrack (de.mossgrabers.framework.daw.data.ITrack)16 IChannelBank (de.mossgrabers.framework.daw.IChannelBank)10 View (de.mossgrabers.framework.view.View)9 ICursorDevice (de.mossgrabers.framework.daw.ICursorDevice)8 ModeManager (de.mossgrabers.framework.mode.ModeManager)7 DrumView (de.mossgrabers.launchpad.view.DrumView)7 PlayView (de.mossgrabers.launchpad.view.PlayView)7 RaindropsView (de.mossgrabers.launchpad.view.RaindropsView)7 SequencerView (de.mossgrabers.launchpad.view.SequencerView)7 AbstractSequencerView (de.mossgrabers.framework.view.AbstractSequencerView)6 ColorView (de.mossgrabers.push.view.ColorView)6 APCControlSurface (de.mossgrabers.apc.controller.APCControlSurface)5 PushControlSurface (de.mossgrabers.push.controller.PushControlSurface)5 IBrowser (de.mossgrabers.framework.daw.IBrowser)4 ITrackBank (de.mossgrabers.framework.daw.ITrackBank)4 MCUControlSurface (de.mossgrabers.mcu.controller.MCUControlSurface)4 ColorManager (de.mossgrabers.framework.controller.color.ColorManager)3 Scales (de.mossgrabers.framework.scale.Scales)3 SceneView (de.mossgrabers.framework.view.SceneView)3