use of de.mossgrabers.controller.ni.maschine.mk3.MaschineConfiguration in project DrivenByMoss by git-moss.
the class MainKnobRowModeCommand method execute.
/**
* {@inheritDoc}
*/
@Override
public void execute(final int value) {
if (this.surface.isPressed(ButtonID.SCENE1)) {
this.switchPage(ButtonID.SCENE1, this.model.getSceneBank(), value);
return;
}
if (this.surface.isPressed(ButtonID.CLIP)) {
final Optional<ITrack> selectedTrack = this.model.getCurrentTrackBank().getSelectedItem();
if (selectedTrack.isPresent())
this.switchPage(ButtonID.CLIP, selectedTrack.get().getSlotBank(), value);
return;
}
if (this.surface.isPressed(ButtonID.TRACK)) {
this.switchPage(ButtonID.TRACK, this.model.getCurrentTrackBank(), value);
return;
}
if (this.surface.isPressed(ButtonID.SOLO)) {
this.switchPage(ButtonID.SOLO, this.model.getCurrentTrackBank(), value);
return;
}
if (this.surface.isPressed(ButtonID.MUTE)) {
this.switchPage(ButtonID.MUTE, this.model.getCurrentTrackBank(), value);
return;
}
if (this.surface.isPressed(ButtonID.ACCENT)) {
final int speed = this.model.getValueChanger().decode(value);
this.surface.setTriggerConsumed(ButtonID.ACCENT);
final MaschineConfiguration configuration = this.surface.getConfiguration();
final int v = Math.min(Math.max(1, configuration.getFixedAccentValue() + speed), 127);
configuration.setFixedAccentValue(v);
this.surface.getDisplay().notify("Fixed Accent: " + v);
return;
}
super.execute(value);
}
use of de.mossgrabers.controller.ni.maschine.mk3.MaschineConfiguration in project DrivenByMoss by git-moss.
the class PlayConfigurationMode method update.
private void update() {
this.surface.getViewManager().get(Views.PLAY).updateNoteMapping();
final MaschineConfiguration config = this.surface.getConfiguration();
final Scales scales = this.model.getScales();
config.setScale(scales.getScale().getName());
config.setScaleBase(Scales.BASES.get(scales.getScaleOffset()));
config.setScaleLayout(scales.getScaleLayout().getName());
}
Aggregations