Search in sources :

Example 16 with ModeManager

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

the class SetupCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes mode = this.getMode();
    if (modeManager.isActive(mode))
        modeManager.restore();
    else
        modeManager.setTemporary(mode);
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 17 with ModeManager

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

the class VolumeCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes currentMode = modeManager.getActiveID();
    // Layer mode selection for Push 1
    final PushConfiguration config = this.surface.getConfiguration();
    if (!config.isPush2() && this.surface.isSelectPressed() && Modes.isLayerMode(currentMode)) {
        modeManager.setActive(Modes.DEVICE_LAYER_VOLUME);
        return;
    }
    if (Modes.VOLUME.equals(currentMode)) {
        if (this.model.getHost().supports(Capability.HAS_CROSSFADER))
            modeManager.setActive(Modes.CROSSFADER);
    } else
        modeManager.setActive(Modes.VOLUME);
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 18 with ModeManager

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

the class SelectCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    // Update for key combinations
    this.surface.getViewManager().getActive().updateNoteMapping();
    final ModeManager modeManager = this.surface.getModeManager();
    // Don't do anything in browser mode
    if (modeManager.isActive(Modes.BROWSER))
        return;
    if (event == ButtonEvent.DOWN) {
        // Track or layer details?
        if (Modes.isLayerMode(modeManager.getActiveID()))
            modeManager.setActive(Modes.DEVICE_LAYER_DETAILS);
        else
            modeManager.setActive(Modes.TRACK_DETAILS);
    } else if (event == ButtonEvent.UP && modeManager.isActive(Modes.TRACK_DETAILS, Modes.DEVICE_LAYER_DETAILS))
        modeManager.restore();
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 19 with ModeManager

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

the class SelectSessionViewCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event == ButtonEvent.DOWN) {
        this.isTemporary = false;
        final ViewManager viewManager = this.surface.getViewManager();
        final ModeManager modeManager = this.surface.getModeManager();
        if (Views.isSessionView(viewManager.getActiveID())) {
            if (modeManager.isActive(Modes.SESSION_VIEW_SELECT))
                modeManager.restore();
            else
                modeManager.setTemporary(Modes.SESSION_VIEW_SELECT);
            return;
        }
        // Switch to the preferred session view and display scene/clip mode if enabled
        final PushConfiguration configuration = this.surface.getConfiguration();
        viewManager.setActive(configuration.isScenesClipViewSelected() ? Views.SCENE_PLAY : Views.SESSION);
        if (configuration.shouldDisplayScenesOrClips())
            modeManager.setActive(Modes.SESSION);
        return;
    }
    if (event == ButtonEvent.UP && this.isTemporary)
        this.surface.getViewManager().restore();
}
Also used : PushConfiguration(de.mossgrabers.controller.ableton.push.PushConfiguration) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 20 with ModeManager

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

the class ShiftCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes cm = modeManager.getActiveID();
    if (event == ButtonEvent.DOWN && Modes.SCALES.equals(cm))
        modeManager.setTemporary(Modes.SCALE_LAYOUT);
    else if (event == ButtonEvent.UP && Modes.SCALE_LAYOUT.equals(cm))
        modeManager.restore();
    this.surface.setKnobSensitivityIsSlow(this.surface.isShiftPressed());
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Aggregations

ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)90 Modes (de.mossgrabers.framework.mode.Modes)22 ITrack (de.mossgrabers.framework.daw.data.ITrack)15 ITrackBank (de.mossgrabers.framework.daw.data.bank.ITrackBank)15 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)11 ICursorDevice (de.mossgrabers.framework.daw.data.ICursorDevice)10 PushConfiguration (de.mossgrabers.controller.ableton.push.PushConfiguration)6 MaschineControlSurface (de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface)4 StudioEncoderModeManager (de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager)4 EditNoteMode (de.mossgrabers.controller.ni.maschine.mk3.mode.EditNoteMode)4 StepState (de.mossgrabers.framework.daw.StepState)4 INoteMode (de.mossgrabers.framework.mode.INoteMode)4 IMode (de.mossgrabers.framework.featuregroup.IMode)3 NoteMode (de.mossgrabers.controller.akai.apc.mode.NoteMode)2 MCUConfiguration (de.mossgrabers.controller.mackie.mcu.MCUConfiguration)2 SLControlSurface (de.mossgrabers.controller.novation.sl.controller.SLControlSurface)2 SLMkIIIControlSurface (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIControlSurface)2 SLMkIIIDisplay (de.mossgrabers.controller.novation.slmkiii.controller.SLMkIIIDisplay)2 IHwRelativeKnob (de.mossgrabers.framework.controller.hardware.IHwRelativeKnob)2 INoteClip (de.mossgrabers.framework.daw.INoteClip)2