30 Sync(l10n::String newName, l10n::String newTitle,
bool isReverbSidechain =
false)
31 :
SyncLevel(newName, newTitle), is_reverb_sidechain_{isReverbSidechain} {}
33 size_t size()
override {
return 10; };
35 const auto sidechain = getSidechain(is_reverb_sidechain_);
36 this->setValue(syncTypeAndLevelToMenuOption(sidechain->syncType, sidechain->syncLevel));
39 void writeCurrentValue()
override {
40 int32_t current_value = this->getValue();
43 if (!is_reverb_sidechain_ && currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR
44 && soundEditor.editingKitRow()) {
46 Kit* kit = getCurrentKit();
48 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
49 if (thisDrum->type == DrumType::SOUND) {
50 auto* soundDrum =
static_cast<SoundDrum*
>(thisDrum);
52 soundDrum->sidechain.syncType = syncValueToSyncType(current_value);
53 soundDrum->sidechain.syncLevel = syncValueToSyncLevel(current_value);
59 const auto sidechain = getSidechain(is_reverb_sidechain_);
60 sidechain->syncType = syncValueToSyncType(current_value);
61 sidechain->syncLevel = syncValueToSyncLevel(current_value);
64 AudioEngine::mustUpdateReverbParamsBeforeNextRender =
true;
67 return !is_reverb_sidechain_ || AudioEngine::reverbSidechainVolume >= 0;
71 bool is_reverb_sidechain_;