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