Search in sources :

Example 6 with INoteMode

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

the class PlayConfigurationMode 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);
    switch(idx) {
        case 0:
        case 1:
        case 2:
            if (inc)
                scales.nextScale();
            else
                scales.prevScale();
            if (!this.surface.getMaschine().hasMCUDisplay())
                this.surface.getDisplay().notify(scales.getScale().getName());
            break;
        case 3:
            if (inc)
                scales.nextScaleOffset();
            else
                scales.prevScaleOffset();
            break;
        case 4:
        case 5:
            if (inc)
                scales.nextScaleLayout();
            else
                scales.prevScaleLayout();
            break;
        case 6:
            scales.setChromatic(!inc);
            this.surface.getConfiguration().setScaleInKey(!scales.isChromatic());
            break;
        case 7:
            final PlayView playView = (PlayView) this.surface.getViewManager().get(Views.PLAY);
            if (inc)
                playView.onOctaveUp(ButtonEvent.DOWN);
            else
                playView.onOctaveDown(ButtonEvent.DOWN);
            ((INoteMode) this.surface.getModeManager().get(Modes.NOTE)).clearNotes();
            break;
        default:
            // Not used
            break;
    }
    this.update();
}
Also used : INoteMode(de.mossgrabers.framework.mode.INoteMode) Scales(de.mossgrabers.framework.scale.Scales) PlayView(de.mossgrabers.controller.ni.maschine.mk3.view.PlayView)

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