Search in sources :

Example 51 with ViewManager

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

the class DrumConfigurationMode method onKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobValue(final int index, final int value) {
    if (!this.model.canSelectedTrackHoldNotes())
        return;
    final int idx = index < 0 ? this.selectedParam : index;
    final Scales scales = this.model.getScales();
    final boolean inc = this.model.getValueChanger().isIncrease(value);
    final ViewManager viewManager = this.surface.getViewManager();
    switch(idx) {
        case 6:
        case 7:
            ((DrumView) viewManager.get(Views.DRUM)).changeOctave(ButtonEvent.DOWN, inc, scales.getDrumDefaultOffset(), true, false);
            viewManager.get(Views.DRUM).updateNoteMapping();
            ((INoteMode) this.surface.getModeManager().get(Modes.NOTE)).clearNotes();
            break;
        default:
            // Not used
            break;
    }
}
Also used : INoteMode(de.mossgrabers.framework.mode.INoteMode) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) Scales(de.mossgrabers.framework.scale.Scales) DrumView(de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)

Example 52 with ViewManager

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

the class MaschineJamSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final ViewManager viewManager = this.surface.getViewManager();
    final SessionView sessionView = (SessionView) viewManager.get(Views.SESSION);
    final Configuration configuration = this.surface.getConfiguration();
    if (event == ButtonEvent.UP) {
        // Toggle Arrange and Mix panel layout
        if (this.surface.isShiftPressed()) {
            final IApplication application = this.model.getApplication();
            final boolean isArrange = IApplication.PANEL_LAYOUT_ARRANGE.equals(application.getPanelLayout());
            application.setPanelLayout(isArrange ? IApplication.PANEL_LAYOUT_MIX : IApplication.PANEL_LAYOUT_ARRANGE);
            return;
        }
        if (viewManager.isActive(Views.SESSION)) {
            // Disable birds-eye-view if active
            if (sessionView.isBirdsEyeActive()) {
                sessionView.setBirdsEyeActive(false);
                this.notifyViewName(false, configuration.isFlipSession());
                return;
            }
            // Flip clips
            final boolean flipped = !configuration.isFlipSession();
            configuration.setFlipSession(flipped);
            this.notifyViewName(false, flipped);
            return;
        }
        // Activate session view
        viewManager.setActive(Views.SESSION);
        this.notifyViewName(false, configuration.isFlipSession());
    } else if (event == ButtonEvent.LONG) {
        // Only trigger birds-eye-view if session view is already active
        this.surface.setTriggerConsumed(ButtonID.SESSION);
        sessionView.setBirdsEyeActive(true);
        this.notifyViewName(true, configuration.isFlipSession());
    }
}
Also used : IApplication(de.mossgrabers.framework.daw.IApplication) Configuration(de.mossgrabers.framework.configuration.Configuration) MaschineJamConfiguration(de.mossgrabers.controller.ni.maschine.jam.MaschineJamConfiguration) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) SessionView(de.mossgrabers.controller.ni.maschine.jam.view.SessionView)

Example 53 with ViewManager

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

the class MaschineJamStartSceneCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (this.surface.isPressed(ButtonID.SEQUENCER)) {
        this.surface.setTriggerConsumed(ButtonID.SEQUENCER);
        if (SEQUENCER_VIEWS[this.index] != null) {
            this.activatePreferredView(SEQUENCER_VIEWS[this.index]);
            this.mvHelper.delayDisplay(() -> viewManager.getActive().getName());
        }
        return;
    }
    if (this.surface.isPressed(ButtonID.NOTE)) {
        this.surface.setTriggerConsumed(ButtonID.NOTE);
        if (PLAY_VIEWS[this.index] != null) {
            this.activatePreferredView(PLAY_VIEWS[this.index]);
            this.mvHelper.delayDisplay(() -> viewManager.getActive().getName());
        }
        return;
    }
    super.executeNormal(event);
}
Also used : ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 54 with ViewManager

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

the class AbstractControllerSetup method activateBrowserObserver.

/**
 * De-/Activate the browser view depending on the browsers' active state.
 *
 * @param browserView The view to hide/show when the browser becomes de-/active
 */
protected void activateBrowserObserver(final Views browserView) {
    this.model.getBrowser().addActiveObserver(isActive -> {
        final ViewManager viewManager = this.getSurface().getViewManager();
        if (isActive.booleanValue()) {
            final Views previousViewId = viewManager.getPreviousID();
            viewManager.setTemporary(browserView);
            if (viewManager.getPreviousID() == Views.SHIFT)
                viewManager.setPreviousID(previousViewId);
        } else if (viewManager.isActive(browserView))
            viewManager.restore();
    });
}
Also used : Views(de.mossgrabers.framework.view.Views) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager)

Example 55 with ViewManager

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

the class ViewMultiSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != this.triggerEvent)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    final Views activeViewId = viewManager.getActiveID();
    int index = this.viewIds.indexOf(activeViewId) + 1;
    if (index < 0 || index >= this.viewIds.size())
        index = 0;
    final Views viewId = this.viewIds.get(index);
    if (viewManager.isActive(viewId))
        return;
    viewManager.setActive(viewId);
    if (this.displayName)
        this.surface.getDisplay().notify(viewManager.get(viewId).getName());
}
Also used : Views(de.mossgrabers.framework.view.Views) 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