Search in sources :

Example 81 with ModeManager

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

the class MaschineControllerSetup method createModes.

/**
 * {@inheritDoc}
 */
@Override
protected void createModes() {
    final MaschineControlSurface surface = this.getSurface();
    final ModeManager modeManager = surface.getModeManager();
    modeManager.register(Modes.BROWSER, new BrowseMode(surface, this.model));
    modeManager.register(Modes.VOLUME, new MaschineVolumeMode(surface, this.model));
    modeManager.register(Modes.PAN, new MaschinePanMode(surface, this.model));
    for (int i = 0; i < 8; i++) modeManager.register(Modes.get(Modes.SEND1, i), new MaschineSendMode(i, surface, this.model));
    modeManager.register(Modes.TEMPO, new TempoMode(surface, this.model));
    modeManager.register(Modes.POSITION, new PositionMode(surface, this.model));
    modeManager.register(Modes.LOOP_START, new LoopStartMode(surface, this.model));
    modeManager.register(Modes.LOOP_LENGTH, new LoopLengthMode(surface, this.model));
    modeManager.register(Modes.REPEAT_NOTE, new NoteRepeatMode(surface, this.model));
    modeManager.register(Modes.SCALES, new PlayConfigurationMode(surface, this.model));
    modeManager.register(Modes.PLAY_OPTIONS, new DrumConfigurationMode(surface, this.model));
    modeManager.register(Modes.NOTE, new EditNoteMode(surface, this.model));
    modeManager.register(Modes.DEVICE_PARAMS, new MaschineParametersMode(surface, this.model));
    if (this.maschine.hasMCUDisplay())
        modeManager.register(Modes.USER, new MaschineUserMode(surface, this.model));
    modeManager.setDefaultID(Modes.VOLUME);
}
Also used : PositionMode(de.mossgrabers.controller.ni.maschine.mk3.mode.PositionMode) PlayConfigurationMode(de.mossgrabers.controller.ni.maschine.mk3.mode.PlayConfigurationMode) MaschineParametersMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschineParametersMode) MaschineUserMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschineUserMode) DrumConfigurationMode(de.mossgrabers.controller.ni.maschine.mk3.mode.DrumConfigurationMode) MaschineControlSurface(de.mossgrabers.controller.ni.maschine.mk3.controller.MaschineControlSurface) BrowseMode(de.mossgrabers.controller.ni.maschine.mk3.mode.BrowseMode) MaschinePanMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschinePanMode) MaschineSendMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschineSendMode) TempoMode(de.mossgrabers.controller.ni.maschine.mk3.mode.TempoMode) LoopLengthMode(de.mossgrabers.controller.ni.maschine.mk3.mode.LoopLengthMode) EditNoteMode(de.mossgrabers.controller.ni.maschine.mk3.mode.EditNoteMode) MaschineVolumeMode(de.mossgrabers.controller.ni.maschine.mk3.mode.MaschineVolumeMode) NoteRepeatMode(de.mossgrabers.controller.ni.maschine.mk3.mode.NoteRepeatMode) LoopStartMode(de.mossgrabers.controller.ni.maschine.mk3.mode.LoopStartMode) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager) StudioEncoderModeManager(de.mossgrabers.controller.ni.maschine.mk3.controller.StudioEncoderModeManager)

Example 82 with ModeManager

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

the class DrumView method handleSequencerAreaButtonCombinations.

/**
 * {@inheritDoc}
 */
@Override
protected boolean handleSequencerAreaButtonCombinations(final INoteClip clip, final int channel, final int step, final int note, final int velocity) {
    if (this.isButtonCombination(ButtonID.MUTE)) {
        final IStepInfo stepInfo = clip.getStep(channel, step, note);
        final StepState isSet = stepInfo.getState();
        if (isSet == StepState.START)
            this.getClip().updateMuteState(channel, step, note, !stepInfo.isMuted());
        return true;
    }
    final ModeManager modeManager = this.surface.getModeManager();
    if (modeManager.isActive(Modes.NOTE)) {
        this.model.getHost().showNotification("Note " + Scales.formatNoteAndOctave(note, -3) + " - Step " + Integer.toString(step + 1));
        this.editNote(clip, channel, step, note, true);
        return true;
    }
    final boolean isSelectPressed = this.surface.isSelectPressed();
    if (isSelectPressed) {
        if (velocity > 0)
            this.handleSequencerAreaRepeatOperator(clip, channel, step, note, velocity, isSelectPressed);
        return true;
    }
    return super.handleSequencerAreaButtonCombinations(clip, channel, step, note, velocity);
}
Also used : StepState(de.mossgrabers.framework.daw.StepState) IStepInfo(de.mossgrabers.framework.daw.IStepInfo) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 83 with ModeManager

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

the class PadModeCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    if (event != ButtonEvent.DOWN)
        return;
    final ViewManager viewManager = this.surface.getViewManager();
    if (viewManager.isActive(Views.DRUM)) {
        if (!this.surface.getMaschine().hasMCUDisplay())
            ((DrumView) viewManager.get(Views.DRUM)).toggleShifted();
        final ModeManager modeManager = this.surface.getModeManager();
        if (modeManager.isActive(Modes.PLAY_OPTIONS))
            modeManager.restore();
        else
            modeManager.setActive(Modes.PLAY_OPTIONS);
    } else {
        viewManager.setActive(Views.DRUM);
        ((INoteMode) this.surface.getModeManager().get(Modes.NOTE)).clearNotes();
    }
}
Also used : INoteMode(de.mossgrabers.framework.mode.INoteMode) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 84 with ModeManager

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

the class PageCommand 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 = modeManager.getActiveID();
    switch(mode) {
        case DEVICE_PARAMS:
            final ICursorDevice cursorDevice = this.model.getCursorDevice();
            if (this.direction == Direction.LEFT)
                cursorDevice.selectPrevious();
            else
                cursorDevice.selectNext();
            this.mvHelper.notifySelectedDevice();
            break;
        case USER:
            final IParameterBank userBank = this.model.getUserParameterBank();
            if (this.direction == Direction.LEFT)
                userBank.selectPreviousPage();
            else
                userBank.selectNextPage();
            this.mvHelper.notifySelectedUserPage();
            break;
        case BROWSER:
            if (this.direction == Direction.LEFT)
                this.model.getBrowser().previousContentType();
            else
                this.model.getBrowser().nextContentType();
            break;
        default:
            final ITrack cursorTrack = this.model.getCursorTrack();
            if (!cursorTrack.doesExist())
                return;
            final ISlotBank slotBank = cursorTrack.getSlotBank();
            if (this.direction == Direction.LEFT) {
                if (this.surface.isShiftPressed()) {
                    this.surface.setStopConsumed();
                    slotBank.selectPreviousPage();
                } else
                    slotBank.selectPreviousItem();
            } else {
                if (this.surface.isShiftPressed()) {
                    this.surface.setStopConsumed();
                    slotBank.selectNextPage();
                } else
                    slotBank.selectNextItem();
            }
            break;
    }
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ISlotBank(de.mossgrabers.framework.daw.data.bank.ISlotBank) ITrack(de.mossgrabers.framework.daw.data.ITrack) IParameterBank(de.mossgrabers.framework.daw.data.bank.IParameterBank) ICursorDevice(de.mossgrabers.framework.daw.data.ICursorDevice) ModeManager(de.mossgrabers.framework.featuregroup.ModeManager)

Example 85 with ModeManager

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

the class MaschineSendSelectCommand method executeNormal.

/**
 * {@inheritDoc}
 */
@Override
public void executeNormal(final ButtonEvent event) {
    final ModeManager modeManager = this.surface.getModeManager();
    final Modes activeMode = modeManager.getActiveID();
    super.executeNormal(event);
    final Modes newMode = modeManager.getActiveID();
    if (activeMode == newMode)
        return;
    final int sendIndex = newMode.ordinal() - Modes.SEND1.ordinal();
    final Optional<ITrack> t = this.model.getCurrentTrackBank().getSelectedItem();
    if (t.isEmpty())
        return;
    final ISendBank sendBank = t.get().getSendBank();
    final ISend send = sendBank.getItem(sendIndex);
    if (send.doesExist())
        this.surface.getDisplay().notify("Send " + (sendIndex + 1) + ": " + send.getName());
}
Also used : Modes(de.mossgrabers.framework.mode.Modes) ITrack(de.mossgrabers.framework.daw.data.ITrack) ISend(de.mossgrabers.framework.daw.data.ISend) ISendBank(de.mossgrabers.framework.daw.data.bank.ISendBank) 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