Search in sources :

Example 36 with ModeManager

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

the class AssignableCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    final MCUConfiguration configuration = this.surface.getConfiguration();
    switch(this.getSetting()) {
        case MCUConfiguration.FOOTSWITCH_2_PREV_MODE:
            if (event == ButtonEvent.DOWN)
                this.switcher.scrollDown();
            break;
        case MCUConfiguration.FOOTSWITCH_2_NEXT_MODE:
            if (event == ButtonEvent.DOWN)
                this.switcher.scrollUp();
            break;
        case MCUConfiguration.FOOTSWITCH_2_SHOW_MARKER_MODE:
            if (event != ButtonEvent.DOWN)
                return;
            final ModeManager modeManager = this.surface.getModeManager();
            if (modeManager.isActive(Modes.MARKERS))
                modeManager.restore();
            else
                modeManager.setActive(Modes.MARKERS);
            final IMode mode = modeManager.getActive();
            if (mode != null)
                this.surface.getDisplay().notify(mode.getName());
            break;
        case MCUConfiguration.FOOTSWITCH_2_USE_FADERS_LIKE_EDIT_KNOBS:
            this.flipCommand.executeNormal(event);
            break;
        case MCUConfiguration.FOOTSWITCH_2_TOGGLE_MOTOR_FADERS_ON_OFF:
            if (event != ButtonEvent.DOWN)
                return;
            configuration.toggleMotorFaders();
            this.mvHelper.delayDisplay(() -> "Motor Faders: " + (configuration.hasMotorFaders() ? "On" : "Off"));
            break;
        case MCUConfiguration.FOOTSWITCH_2_ACTION:
            if (event != ButtonEvent.DOWN)
                return;
            final String assignableActionID = configuration.getAssignableAction(this.index);
            if (assignableActionID != null)
                this.model.getApplication().invokeAction(assignableActionID);
            break;
        default:
            super.execute(event, velocity);
            break;
    }
}
Also used : MCUConfiguration(de.mossgrabers.controller.mackie.mcu.MCUConfiguration) IMode(de.mossgrabers.framework.featuregroup.IMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 37 with ModeManager

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

the class ModeSwitcher method scrollUp.

/**
 * Scroll upwards through the modes.
 */
public void scrollUp() {
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes activeModeId = modeManager.getActiveID();
    if (Modes.PAN == activeModeId) {
        modeManager.setActive(Modes.VOLUME);
        this.surface.getDisplay().notify("Volume");
    } else if (Modes.VOLUME == activeModeId) {
        modeManager.setActive(Modes.TRACK);
        this.surface.getDisplay().notify("Track");
    } else if (Modes.TRACK == activeModeId) {
        modeManager.setActive(Modes.DEVICE_PARAMS);
        this.surface.getDisplay().notify("Parameters");
    } else {
        modeManager.setActive(Modes.PAN);
        this.surface.getDisplay().notify("Panorama");
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 38 with ModeManager

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

the class FaderTouchCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final MCUConfiguration configuration = this.surface.getConfiguration();
    if (event == ButtonEvent.LONG || configuration.useFadersAsKnobs())
        return;
    final boolean isTouched = event == ButtonEvent.DOWN;
    // Master Channel
    if (this.index == 8) {
        if (isTouched && configuration.isTouchChannel())
            this.model.getMasterTrack().select();
        return;
    }
    // Select channel
    if (configuration.isTouchChannel() && event == ButtonEvent.DOWN)
        this.getTrackBank().getItem(this.channel).select();
    final ModeManager modeManager = this.surface.getModeManager();
    if (configuration.useFadersAsKnobs()) {
        modeManager.getActive().onKnobTouch(this.index, isTouched);
        return;
    }
    modeManager.get(Modes.VOLUME).onKnobTouch(this.index, isTouched);
    final int pos = this.surface.getSurfaceID() * 8 + this.index;
    // Temporarily enable volume mode
    if (isTouched) {
        if (!hasTouchedFader()) {
            if (modeManager.isActive(Modes.VOLUME))
                modeManager.setPreviousID(Modes.VOLUME);
            else
                modeManager.setActive(Modes.VOLUME);
        }
        setTouchedFader(pos, true);
    } else {
        setTouchedFader(pos, false);
        if (!hasTouchedFader())
            modeManager.restore();
    }
}
Also used : MCUConfiguration(de.mossgrabers.controller.mackie.mcu.MCUConfiguration) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 39 with ModeManager

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

the class LaunchkeyMk3ControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final LaunchkeyMk3ControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.register(Modes.VOLUME, new LaunchkeyMk3VolumeMode(surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    modeManager.register(Modes.PAN, new LaunchkeyMk3PanoramaMode(surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    modeManager.register(Modes.SEND1, new LaunchkeyMk3SendMode(0, surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    modeManager.register(Modes.SEND2, new LaunchkeyMk3SendMode(1, surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    modeManager.register(Modes.DEVICE_PARAMS, new LaunchkeyMk3ParameterMode(surface, this.model, AbstractMode.DEFAULT_KNOB_IDS));
    // Layer send X IDs are used for custom modes
    modeManager.register(Modes.DEVICE_LAYER_SEND1, new CustomMode(1, surface, this.model));
    modeManager.register(Modes.DEVICE_LAYER_SEND2, new CustomMode(2, surface, this.model));
    modeManager.register(Modes.DEVICE_LAYER_SEND3, new CustomMode(3, surface, this.model));
    modeManager.register(Modes.DEVICE_LAYER_SEND4, new CustomMode(4, surface, this.model));
    final ModeManager faderModeManager = surface.getFaderModeManager();
    faderModeManager.register(Modes.DEVICE_PARAMS, new LaunchkeyMk3ParameterMode(surface, this.model, DEFAULT_FADER_IDS));
    faderModeManager.register(Modes.VOLUME, new LaunchkeyMk3VolumeMode(surface, this.model, DEFAULT_FADER_IDS));
    faderModeManager.register(Modes.SEND1, new LaunchkeyMk3SendMode(0, surface, this.model, DEFAULT_FADER_IDS));
    faderModeManager.register(Modes.SEND2, new LaunchkeyMk3SendMode(1, surface, this.model, DEFAULT_FADER_IDS));
    faderModeManager.register(Modes.DEVICE_LAYER_SEND1, new CustomMode(1, surface, this.model));
    faderModeManager.register(Modes.DEVICE_LAYER_SEND2, new CustomMode(2, surface, this.model));
    faderModeManager.register(Modes.DEVICE_LAYER_SEND3, new CustomMode(3, surface, this.model));
    faderModeManager.register(Modes.DEVICE_LAYER_SEND4, new CustomMode(4, surface, this.model));
}
Also used : CustomMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.CustomMode) LaunchkeyMk3ControlSurface(de.mossgrabers.controller.novation.launchkey.maxi.controller.LaunchkeyMk3ControlSurface) LaunchkeyMk3ParameterMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3ParameterMode) LaunchkeyMk3PanoramaMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3PanoramaMode) LaunchkeyMk3SendMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3SendMode) LaunchkeyMk3VolumeMode(de.mossgrabers.controller.novation.launchkey.maxi.mode.LaunchkeyMk3VolumeMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 40 with ModeManager

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

the class AbstractTrackCommand method onModeButton.

protected void onModeButton(final ButtonEvent event, final Modes controlMode, final String notification) {
    final ModeManager modeManager = this.surface.getModeManager();
    final ViewManager viewManager = this.surface.getViewManager();
    switch(event) {
        case DOWN:
            this.firstRowUsed = false;
            if (modeManager.isActive(controlMode)) {
                modeManager.setActive(Modes.DUMMY);
                return;
            }
            modeManager.setActive(controlMode);
            this.wasSession = viewManager.isActive(Views.SESSION);
            if (!this.wasSession)
                viewManager.setActive(Views.SESSION);
            this.surface.getDisplay().notify(notification);
            break;
        case LONG:
            this.firstRowUsed = true;
            break;
        case UP:
            if (this.firstRowUsed) {
                modeManager.setActive(Modes.DUMMY);
                if (!this.wasSession)
                    viewManager.restore();
            }
            break;
    }
}
Also used : 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