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();
}
Aggregations