Search in sources :

Example 1 with ModeManager

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

the class MastertrackTouchCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final boolean isTouched = event != ButtonEvent.UP;
    // Avoid accidentally leaving the browser
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActive(Modes.BROWSER))
        return;
    final IMasterTrack masterTrack = this.model.getMasterTrack();
    masterTrack.touchVolume(isTouched);
    if (this.surface.isDeletePressed()) {
        this.surface.setTriggerConsumed(ButtonID.DELETE);
        masterTrack.resetVolume();
        return;
    }
    final boolean isMasterMode = modeManager.isActive(Modes.MASTER);
    if (isTouched && isMasterMode)
        return;
    if (isTouched)
        modeManager.setTemporary(Modes.MASTER_TEMP);
    else if (!isMasterMode)
        modeManager.restore();
}
Also used : IMasterTrack(de.mossgrabers.framework.daw.data.IMasterTrack) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 2 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 3 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 4 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 5 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)

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