Search in sources :

Example 56 with ViewManager

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

the class LaunchpadCursorCommand method scrollLeft.

/**
 * {@inheritDoc}
 */
@SuppressWarnings("rawtypes")
@Override
protected void scrollLeft() {
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY)) {
        final Scales scales = this.model.getScales();
        scales.prevScale();
        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.previousParameterPage();
        this.surface.getDisplay().notify(cursorDevice.getSelectedParameterPageName());
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_BROWSER)) {
        this.model.getBrowser().previousContentType();
        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).onLeft(ButtonEvent.DOWN);
        return;
    }
    // VIEW_SESSION, VIEW_VOLUME, VIEW_PAN, VIEW_SENDS
    this.scrollTracksLeft();
}
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)

Example 57 with ViewManager

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

the class SelectDeviceViewCommand 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_BROWSER)) {
        this.model.getBrowser().stopBrowsing(false);
        viewManager.setActiveView(Views.VIEW_DEVICE);
        return;
    }
    if (viewManager.isActiveView(Views.VIEW_DEVICE)) {
        if (this.surface.isShiftPressed() || !this.model.getCursorDevice().hasSelectedDevice())
            this.model.getBrowser().browseToInsertAfterDevice();
        else
            this.model.getBrowser().browseForPresets();
        this.startRetries = 0;
        this.activateBrowserView();
        return;
    }
    viewManager.setActiveView(Views.VIEW_DEVICE);
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 58 with ViewManager

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

the class LaunchpadControllerSetup method updateIndication.

private void updateIndication() {
    final ViewManager viewManager = this.getSurface().getViewManager();
    final boolean isVolume = viewManager.isActiveView(Views.VIEW_VOLUME);
    final boolean isPan = viewManager.isActiveView(Views.VIEW_PAN);
    final boolean isSends = viewManager.isActiveView(Views.VIEW_SENDS);
    final boolean isDevice = viewManager.isActiveView(Views.VIEW_DEVICE);
    final ITrackBank tb = this.model.getTrackBank();
    final IChannelBank tbe = this.model.getEffectTrackBank();
    final ICursorDevice cursorDevice = this.model.getCursorDevice();
    final View view = viewManager.getActiveView();
    final int selSend = view instanceof SendsView ? ((SendsView) view).getSelectedSend() : -1;
    final boolean isSession = view instanceof SessionView && !isVolume && !isPan && !isSends;
    final boolean isEffect = this.model.isEffectTrackBankActive();
    tb.setIndication(!isEffect && isSession);
    tbe.setIndication(isEffect && isSession);
    for (int i = 0; i < 8; i++) {
        final ITrack track = tb.getTrack(i);
        track.setVolumeIndication(!isEffect && isVolume);
        track.setPanIndication(!isEffect && isPan);
        for (int j = 0; j < 8; j++) track.getSend(j).setIndication(!isEffect && isSends && selSend == j);
        final ITrack fxTrack = tbe.getTrack(i);
        fxTrack.setVolumeIndication(isEffect && isVolume);
        fxTrack.setPanIndication(isEffect && isPan);
        cursorDevice.indicateParameter(i, isDevice);
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ITrackBank(de.mossgrabers.framework.daw.ITrackBank) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) SendsView(de.mossgrabers.launchpad.view.SendsView) ViewManager(de.mossgrabers.framework.view.ViewManager) SessionView(de.mossgrabers.launchpad.view.SessionView) VolumeView(de.mossgrabers.launchpad.view.VolumeView) SessionView(de.mossgrabers.launchpad.view.SessionView) SequencerView(de.mossgrabers.launchpad.view.SequencerView) SceneView(de.mossgrabers.framework.view.SceneView) DeviceView(de.mossgrabers.launchpad.view.DeviceView) View(de.mossgrabers.framework.view.View) PanView(de.mossgrabers.launchpad.view.PanView) RaindropsView(de.mossgrabers.launchpad.view.RaindropsView) BrowserView(de.mossgrabers.launchpad.view.BrowserView) DrumView(de.mossgrabers.launchpad.view.DrumView) SendsView(de.mossgrabers.launchpad.view.SendsView) ShiftView(de.mossgrabers.launchpad.view.ShiftView) PlayView(de.mossgrabers.launchpad.view.PlayView) ICursorDevice(de.mossgrabers.framework.daw.ICursorDevice)

Example 59 with ViewManager

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

the class NoteViewSelectMode method activateView.

private void activateView(final Integer viewID) {
    if (viewID == null)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.getView(viewID) == null)
        return;
    viewManager.setActiveView(viewID);
    final ITrack selectedTrack = this.model.getCurrentTrackBank().getSelectedTrack();
    if (selectedTrack != null)
        viewManager.setPreferredView(selectedTrack.getPosition(), viewID);
    this.surface.getModeManager().restoreMode();
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 60 with ViewManager

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

the class NoteViewSelectMode method updateDisplay2.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay2() {
    final ViewManager viewManager = this.surface.getViewManager();
    final PushDisplay display = (PushDisplay) this.surface.getDisplay();
    final DisplayMessage message = display.createMessage();
    for (int i = 0; i < VIEWS.length; i++) {
        String menuBottomName = "";
        if (VIEWS[i] != null) {
            final View view = viewManager.getView(VIEWS[i]);
            if (view != null)
                menuBottomName = view.getName();
        }
        final String menuTopName = VIEWS_TOP[i] == null ? "" : viewManager.getView(VIEWS_TOP[i]).getName();
        final boolean isMenuBottomSelected = VIEWS[i] != null && viewManager.isActiveView(VIEWS[i]);
        final boolean isMenuTopSelected = VIEWS_TOP[i] != null && viewManager.isActiveView(VIEWS_TOP[i]);
        message.addOptionElement("", menuTopName, isMenuTopSelected, i == 0 ? "Note view" : "", menuBottomName, isMenuBottomSelected, false);
    }
    display.send(message);
}
Also used : PushDisplay(de.mossgrabers.push.controller.PushDisplay) ViewManager(de.mossgrabers.framework.view.ViewManager) DisplayMessage(de.mossgrabers.push.controller.DisplayMessage) View(de.mossgrabers.framework.view.View)

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