Search in sources :

Example 11 with ViewManager

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

the class LaunchpadToggleShiftViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final ViewManager viewManager = this.surface.getViewManager();
    if (event == ButtonEvent.DOWN && (viewManager.isActive(Views.TEMPO) || viewManager.isActive(Views.SHUFFLE))) {
        viewManager.restore();
        this.surface.setTriggerConsumed(ButtonID.SHIFT);
        return;
    }
    super.execute(event, velocity);
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 12 with ViewManager

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

the class SelectDeviceViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (this.surface.isPro() && this.surface.isShiftPressed()) {
        if (viewManager.isActive(Views.SHIFT))
            viewManager.restore();
        viewManager.setTemporary(Views.TEMPO);
        this.surface.getDisplay().notify(viewManager.getActive().getName());
        return;
    }
    final IBrowser browser = this.model.getBrowser();
    if (viewManager.isActive(Views.BROWSER)) {
        browser.stopBrowsing(false);
        viewManager.setActive(Views.DEVICE);
        this.surface.getDisplay().notify(viewManager.getActive().getName());
        return;
    }
    if (viewManager.isActive(Views.DEVICE)) {
        final ICursorDevice cursorDevice = this.model.getCursorDevice();
        if (this.surface.isShiftPressed() || !cursorDevice.doesExist())
            browser.insertAfterCursorDevice();
        else
            browser.replace(cursorDevice);
        return;
    }
    viewManager.setActive(Views.DEVICE);
    this.surface.getDisplay().notify(viewManager.getActive().getName());
}
Also used : IBrowser(de.mossgrabers.framework.daw.IBrowser) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice)

Example 13 with ViewManager

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

the class NoteViewSelectView method drawGrid.

/**
 * {@inheritDoc}
 */
@Override
public void drawGrid() {
    final ViewManager viewManager = this.surface.getViewManager();
    final Views previousViewId = viewManager.getPreviousID();
    final IPadGrid padGrid = this.surface.getPadGrid();
    for (int i = 36; i < 60; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    padGrid.light(60, previousViewId == Views.SEQUENCER ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_AMBER_HI);
    padGrid.light(61, previousViewId == Views.POLY_SEQUENCER ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_AMBER_LO);
    padGrid.light(62, previousViewId == Views.RAINDROPS ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_AMBER);
    for (int i = 63; i < 76; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    padGrid.light(76, previousViewId == Views.DRUM ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_HI);
    padGrid.light(77, previousViewId == Views.DRUM4 ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE);
    padGrid.light(78, previousViewId == Views.DRUM8 ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_BLUE_LO);
    for (int i = 79; i < 92; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
    padGrid.light(92, previousViewId == Views.PLAY ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_RED_HI);
    padGrid.light(93, previousViewId == Views.PIANO ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_RED);
    padGrid.light(94, previousViewId == Views.DRUM64 ? LaunchpadColorManager.LAUNCHPAD_COLOR_GREEN : LaunchpadColorManager.LAUNCHPAD_COLOR_RED_LO);
    for (int i = 95; i < 100; i++) padGrid.light(i, LaunchpadColorManager.LAUNCHPAD_COLOR_BLACK);
}
Also used : IPadGrid(de.mossgrabers.framework.controller.grid.IPadGrid) Views(de.mossgrabers.framework.view.Views) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 14 with ViewManager

use of de.mossgrabers.framework.featuregroup.ViewManager 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)

Example 15 with ViewManager

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

the class AbstractTriggerCommand method activatePreferredView.

/**
 * Activates the given view and stores it as the preferred view for the currently active track.
 *
 * @param viewID The ID of the view to activate and store
 */
protected void activatePreferredView(final Views viewID) {
    if (viewID == null)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.get(viewID) == null)
        return;
    viewManager.setActive(viewID);
    final ITrack cursorTrack = this.model.getCursorTrack();
    if (cursorTrack.doesExist())
        viewManager.setPreferredView(cursorTrack.getPosition(), viewID);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Aggregations

ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)58 ITrack (de.mossgrabers.framework.daw.data.ITrack)12 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)11 Views (de.mossgrabers.framework.view.Views)11 INoteMode (de.mossgrabers.framework.mode.INoteMode)5 BeatstepControlSurface (de.mossgrabers.controller.arturia.beatstep.controller.BeatstepControlSurface)4 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)4 IView (de.mossgrabers.framework.featuregroup.IView)4 DrumView (de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)3 ConfiguredRecordCommand (de.mossgrabers.framework.command.trigger.transport.ConfiguredRecordCommand)3 FeatureGroupButtonColorSupplier (de.mossgrabers.framework.command.trigger.view.FeatureGroupButtonColorSupplier)3 IHost (de.mossgrabers.framework.daw.IHost)3 ITransport (de.mossgrabers.framework.daw.ITransport)3 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)3 PlayView (de.mossgrabers.controller.arturia.beatstep.view.PlayView)2 LaunchkeyMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface)2 LaunchkeyMiniMk3ControlSurface (de.mossgrabers.controller.novation.launchkey.mini.controller.LaunchkeyMiniMk3ControlSurface)2 SLMkIIIControlSurface (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)2 DrumView (de.mossgrabers.controller.novation.slmkiii.view.DrumView)2 Configuration (de.mossgrabers.framework.configuration.Configuration)2