28class Sync final :
public SyncLevel, FormattedTitle {
30 Sync(l10n::String name, l10n::String title, uint8_t lfoId)
31 :
SyncLevel(name, title), FormattedTitle(title, lfoId + 1), lfoId_(lfoId) {}
33 [[nodiscard]] std::string_view
getTitle()
const override {
return FormattedTitle::title(); }
36 this->setValue(syncTypeAndLevelToMenuOption(soundEditor.currentSound->lfoConfig[lfoId_].syncType,
37 soundEditor.currentSound->lfoConfig[lfoId_].syncLevel));
40 void writeCurrentValue()
override {
41 int32_t current_value = this->getValue();
43 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
45 Kit* kit = getCurrentKit();
47 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
48 if (thisDrum->type == DrumType::SOUND) {
49 auto* soundDrum =
static_cast<SoundDrum*
>(thisDrum);
50 soundDrum->lfoConfig[lfoId_].syncType = syncValueToSyncType(current_value);
51 soundDrum->lfoConfig[lfoId_].syncLevel = syncValueToSyncLevel(current_value);
55 soundDrum->resyncGlobalLFOs();
56 soundDrum->setupPatchingForAllParamManagers(currentSong);
62 soundEditor.currentSound->lfoConfig[lfoId_].syncType = syncValueToSyncType(current_value);
63 soundEditor.currentSound->lfoConfig[lfoId_].syncLevel = syncValueToSyncLevel(current_value);
67 soundEditor.currentSound->resyncGlobalLFOs();
68 soundEditor.currentSound->setupPatchingForAllParamManagers(currentSong);