Search in sources :

Example 31 with ViewManager

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

the class SessionViewSelectMode method updateDisplay1.

/**
 * {@inheritDoc}
 */
@Override
public void updateDisplay1() {
    final Display d = this.surface.getDisplay();
    final ViewManager viewManager = this.surface.getViewManager();
    d.clear().setBlock(1, 0, "Session view:");
    for (int i = 0; i < VIEWS.length; i++) {
        if (VIEWS[i] != null)
            d.setCell(3, i, (this.isSelected(viewManager, i) ? PushDisplay.RIGHT_ARROW : "") + VIEW_NAMES[i]);
    }
    d.allDone();
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) Display(de.mossgrabers.framework.controller.display.Display) PushDisplay(de.mossgrabers.push.controller.PushDisplay)

Example 32 with ViewManager

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

the class SessionViewSelectMode method updateFirstRow.

/**
 * {@inheritDoc}
 */
@Override
public void updateFirstRow() {
    final ColorManager colorManager = this.model.getColorManager();
    final ViewManager viewManager = this.surface.getViewManager();
    for (int i = 0; i < 8; i++) this.surface.updateButton(20 + i, colorManager.getColor(VIEWS[i] == null ? AbstractMode.BUTTON_COLOR_OFF : this.isSelected(viewManager, i) ? AbstractMode.BUTTON_COLOR_HI : AbstractMode.BUTTON_COLOR_ON));
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) ColorManager(de.mossgrabers.framework.controller.color.ColorManager)

Example 33 with ViewManager

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

the class SelectPlayViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (Views.isSessionView(viewManager.getActiveViewId())) {
        final IChannelBank tb = this.model.getCurrentTrackBank();
        final ITrack selectedTrack = tb.getSelectedTrack();
        if (selectedTrack == null) {
            this.surface.getDisplay().notify("Please select a track first.");
            return;
        }
        final Integer preferredView = viewManager.getPreferredView(selectedTrack.getPosition());
        viewManager.setActiveView(preferredView == null ? Views.VIEW_PLAY : preferredView);
        return;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActiveMode(Modes.MODE_VIEW_SELECT))
        modeManager.restoreMode();
    else
        modeManager.setActiveMode(Modes.MODE_VIEW_SELECT);
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) IChannelBank(de.mossgrabers.framework.daw.IChannelBank) ViewManager(de.mossgrabers.framework.view.ViewManager) ModeManager(de.mossgrabers.framework.mode.ModeManager)

Example 34 with ViewManager

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

the class LayoutCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActiveView(Views.VIEW_PLAY))
        viewManager.setActiveView(Views.VIEW_PIANO);
    else if (viewManager.isActiveView(Views.VIEW_PIANO))
        viewManager.setActiveView(this.model.getHost().hasClips() ? Views.VIEW_DRUM64 : Views.VIEW_PLAY);
    else if (viewManager.isActiveView(Views.VIEW_DRUM64))
        viewManager.setActiveView(Views.VIEW_PLAY);
    else if (viewManager.isActiveView(Views.VIEW_SEQUENCER))
        viewManager.setActiveView(Views.VIEW_RAINDROPS);
    else if (viewManager.isActiveView(Views.VIEW_RAINDROPS))
        viewManager.setActiveView(Views.VIEW_DRUM);
    else if (viewManager.isActiveView(Views.VIEW_DRUM))
        viewManager.setActiveView(Views.VIEW_DRUM4);
    else if (viewManager.isActiveView(Views.VIEW_DRUM4))
        viewManager.setActiveView(Views.VIEW_DRUM8);
    else if (viewManager.isActiveView(Views.VIEW_DRUM8))
        viewManager.setActiveView(Views.VIEW_SEQUENCER);
    else {
        final PushConfiguration configuration = this.surface.getConfiguration();
        if (viewManager.isActiveView(Views.VIEW_SESSION)) {
            if (configuration.isFlipSession())
                viewManager.setActiveView(Views.VIEW_SCENE_PLAY);
            else
                configuration.setFlipSession(true);
        } else if (viewManager.isActiveView(Views.VIEW_SCENE_PLAY)) {
            configuration.setFlipSession(false);
            viewManager.setActiveView(Views.VIEW_SESSION);
        }
    }
}
Also used : PushConfiguration(de.mossgrabers.push.PushConfiguration) ViewManager(de.mossgrabers.framework.view.ViewManager)

Example 35 with ViewManager

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

the class SLControllerSetup method createViews.

/**
 * {@inheritDoc}
 */
@Override
protected void createViews() {
    final SLControlSurface surface = this.getSurface();
    final ViewManager viewManager = surface.getViewManager();
    viewManager.registerView(Views.VIEW_PLAY, new PlayView(surface, this.model));
    viewManager.registerView(Views.VIEW_CONTROL, new ControlView(surface, this.model));
}
Also used : ViewManager(de.mossgrabers.framework.view.ViewManager) SLControlSurface(de.mossgrabers.sl.controller.SLControlSurface) PlayView(de.mossgrabers.sl.view.PlayView) ControlView(de.mossgrabers.sl.view.ControlView)

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