Search in sources :

Example 26 with ModeManager

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

the class ControlView method onButtonRow1.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonRow1(final int index, final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    Modes activeModeId = modeManager.getActiveID();
    if (Modes.VIEW_SELECT == activeModeId) {
        if (index == 1) {
            this.surface.getViewManager().setActive(Views.PLAY);
            if (Modes.VOLUME.equals(modeManager.getPreviousID()))
                modeManager.restore();
            else
                modeManager.setActive(Modes.SESSION);
        } else
            modeManager.restore();
        this.surface.turnOffTransport();
        return;
    }
    if (!Modes.FUNCTIONS.equals(activeModeId) && !Modes.FIXED.equals(activeModeId)) {
        modeManager.setActive(Modes.FUNCTIONS);
        activeModeId = Modes.FUNCTIONS;
    }
    if (Modes.FIXED.equals(activeModeId)) {
        this.surface.getConfiguration().setNewClipLength(index);
        return;
    }
    switch(index) {
        // Undo
        case 0:
            this.model.getApplication().undo();
            break;
        // Redo
        case 1:
            this.model.getApplication().redo();
            break;
        // Delete
        case 2:
            this.model.getApplication().deleteSelection();
            break;
        // Double
        case 3:
            this.model.getApplication().duplicate();
            break;
        // New
        case 4:
            this.newCommand.execute();
            break;
        // Open the VST window
        case 5:
            this.model.getCursorDevice().toggleWindowOpen();
            break;
        // Metronome
        case 6:
            this.model.getTransport().toggleMetronome();
            break;
        // Tap Tempo on MKII
        case 7:
            this.model.getTransport().tapTempo();
            break;
        default:
            // Not used
            break;
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 27 with ModeManager

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

the class ControlView method onButtonRow2Select.

/**
 * {@inheritDoc}
 */
@Override
public void onButtonRow2Select() {
    final ModeManager modeManager = this.surface.getModeManager();
    final boolean selectFrame = Modes.TRACK_DETAILS.equals(modeManager.getActiveID());
    modeManager.setActive(selectFrame ? Modes.FRAME : Modes.TRACK_DETAILS);
    this.model.getHost().showNotification(selectFrame ? "Layouts & Panels" : "Track & Device");
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 28 with ModeManager

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

the class ButtonRowSelectCommand method execute.

/**
 * {@inheritDoc}
 */
@Override
public void execute(final ButtonEvent event, final int velocity) {
    if (event != ButtonEvent.DOWN)
        return;
    final IView view = this.surface.getViewManager().getActive();
    if (view == null)
        return;
    final ModeManager modeManager = this.surface.getModeManager();
    switch(this.row) {
        case 0:
            ((SLView) view).onButtonRow1Select();
            break;
        case 1:
            modeManager.setActive(Modes.DEVICE_PARAMS);
            this.model.getHost().showNotification("Device Parameters");
            break;
        case 2:
            ((SLView) view).onButtonRow2Select();
            break;
        case 3:
            modeManager.setActive(Modes.TRACK);
            this.model.getHost().showNotification("Track");
            break;
        case 4:
            break;
        case 5:
        case 6:
        case 7:
            modeManager.setActive(Modes.VOLUME);
            this.model.getHost().showNotification("Volume");
            break;
        default:
            // Intentionally empty
            break;
    }
}
Also used : IView(de.mossgrabers.framework.featuregroup.IView) SLView(de.mossgrabers.controller.novation.sl.view.SLView) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 29 with ModeManager

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

the class ShiftView method onButton.

/**
 * {@inheritDoc}
 */
@Override
public void onButton(final ButtonID buttonID, final ButtonEvent event, final int velocity) {
    if (!ButtonID.isSceneButton(buttonID) || event != ButtonEvent.DOWN)
        return;
    switch(buttonID) {
        case SCENE6:
            this.model.toggleCurrentTrackBank();
            final boolean isEffectTrackBank = this.model.isEffectTrackBankActive();
            if (isEffectTrackBank) {
                // No Sends on effect tracks
                final ModeManager modeManager = this.surface.getModeManager();
                if (Modes.isSendMode(modeManager.getActiveID()))
                    modeManager.setActive(Modes.VOLUME);
            }
            this.surface.getDisplay().notify(isEffectTrackBank ? "Effect Tracks" : "Instrument/Audio Tracks");
            break;
        case SCENE7:
            this.model.getCursorDevice().toggleWindowOpen();
            break;
        case SCENE8:
            this.model.getCurrentTrackBank().stop();
            break;
        default:
            final int index = buttonID.ordinal() - ButtonID.SCENE1.ordinal();
            this.surface.setTrackState(index);
            final String softKeys = APCminiConfiguration.SOFT_KEYS_OPTIONS.get(index);
            this.surface.getConfiguration().setSoftKeys(softKeys);
            this.surface.getDisplay().notify(softKeys);
            break;
    }
}
Also used : ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 30 with ModeManager

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

the class StepSequencerSelectCommand method executeNormal.

/**
 * {@inheritDoc}}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final ModeManager modeManager = this.surface.getModeManager();
    // Toggle note mode
    if (this.surface.isPressed(ButtonID.ALT)) {
        if (event == ButtonEvent.DOWN) {
            this.surface.setTriggerConsumed(ButtonID.ALT);
            if (modeManager.isActive(Modes.NOTE))
                modeManager.restore();
            else
                modeManager.setActive(Modes.NOTE);
            this.surface.getDisplay().notify("Edit Notes: " + (modeManager.isActive(Modes.NOTE) ? "On" : "Off"));
            ((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
        }
        return;
    }
    super.executeNormal(event);
    if (event == ButtonEvent.UP) {
        ((INoteMode) modeManager.get(Modes.NOTE)).clearNotes();
        final ITrack cursorTrack = this.model.getCursorTrack();
        if (cursorTrack.doesExist()) {
            final ViewManager viewManager = this.surface.getViewManager();
            viewManager.setPreferredView(cursorTrack.getPosition(), viewManager.getActiveID());
        }
    }
}
Also used : ITrack(de.mossgrabers.framework.daw.data.ITrack) INoteMode(de.mossgrabers.framework.mode.INoteMode) 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