use of de.mossgrabers.framework.daw.midi.INoteInput in project DrivenByMoss by git-moss.
the class AbstractControllerSetup method createNoteRepeatObservers.
protected void createNoteRepeatObservers(final C conf, final S surface) {
final INoteInput defaultNoteInput = surface.getMidiInput().getDefaultNoteInput();
if (defaultNoteInput == null)
return;
final INoteRepeat noteRepeat = defaultNoteInput.getNoteRepeat();
conf.addSettingObserver(AbstractConfiguration.NOTEREPEAT_ACTIVE, () -> noteRepeat.setActive(conf.isNoteRepeatActive()));
conf.addSettingObserver(AbstractConfiguration.NOTEREPEAT_PERIOD, () -> noteRepeat.setPeriod(conf.getNoteRepeatPeriod().getValue()));
if (this.host.supports(Capability.NOTE_REPEAT_LENGTH))
conf.addSettingObserver(AbstractConfiguration.NOTEREPEAT_LENGTH, () -> noteRepeat.setNoteLength(conf.getNoteRepeatLength().getValue()));
if (this.host.supports(Capability.NOTE_REPEAT_MODE))
conf.addSettingObserver(AbstractConfiguration.NOTEREPEAT_MODE, () -> noteRepeat.setMode(conf.getNoteRepeatMode()));
if (this.host.supports(Capability.NOTE_REPEAT_OCTAVES))
conf.addSettingObserver(AbstractConfiguration.NOTEREPEAT_OCTAVE, () -> noteRepeat.setOctaves(conf.getNoteRepeatOctave()));
}
Aggregations