Search in sources :

Example 1 with INoteMode

use of de.mossgrabers.framework.mode.INoteMode 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)

Example 2 with INoteMode

use of de.mossgrabers.framework.mode.INoteMode in project DrivenByMoss by git-moss.

the class DrumSequencerSelectCommand 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)

Example 3 with INoteMode

use of de.mossgrabers.framework.mode.INoteMode in project DrivenByMoss by git-moss.

the class KeyboardCommand 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.PLAY)) {
        if (!this.surface.getMaschine().hasMCUDisplay())
            ((PlayView) viewManager.get(Views.PLAY)).toggleShifted();
        final ModeManager modeManager = this.surface.getModeManager();
        if (modeManager.isActive(Modes.SCALES))
            modeManager.restore();
        else
            modeManager.setTemporary(Modes.SCALES);
    } else {
        viewManager.setActive(Views.PLAY);
        ((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 4 with INoteMode

use of de.mossgrabers.framework.mode.INoteMode 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 5 with INoteMode

use of de.mossgrabers.framework.mode.INoteMode in project DrivenByMoss by git-moss.

the class DrumConfigurationMode method onKnobValue.

/**
 * {@inheritDoc}
 */
@Override
public void onKnobValue(final int index, final int value) {
    if (!this.model.canSelectedTrackHoldNotes())
        return;
    final int idx = index < 0 ? this.selectedParam : index;
    final Scales scales = this.model.getScales();
    final boolean inc = this.model.getValueChanger().isIncrease(value);
    final ViewManager viewManager = this.surface.getViewManager();
    switch(idx) {
        case 6:
        case 7:
            ((DrumView) viewManager.get(Views.DRUM)).changeOctave(ButtonEvent.DOWN, inc, scales.getDrumDefaultOffset(), true, false);
            viewManager.get(Views.DRUM).updateNoteMapping();
            ((INoteMode) this.surface.getModeManager().get(Modes.NOTE)).clearNotes();
            break;
        default:
            // Not used
            break;
    }
}
Also used : INoteMode(de.mossgrabers.framework.mode.INoteMode) ViewManager(de.mossgrabers.framework.featuregroup.ViewManager) Scales(de.mossgrabers.framework.scale.Scales) DrumView(de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)

Aggregations

INoteMode (de.mossgrabers.framework.mode.INoteMode)6 ViewManager (de.mossgrabers.framework.featuregroup.ViewManager)5 ModeManager (de.mossgrabers.framework.featuregroup.ModeManager)4 ITrack (de.mossgrabers.framework.daw.data.ITrack)2 Scales (de.mossgrabers.framework.scale.Scales)2 DrumView (de.mossgrabers.controller.ni.maschine.mk3.view.DrumView)1 PlayView (de.mossgrabers.controller.ni.maschine.mk3.view.PlayView)1