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