33 using Selection::Selection;
34 void readCurrentValue()
override { this->setValue(soundEditor.currentArpSettings->preset); }
37 void writeCurrentValue()
override {
38 auto current_value = this->getValue<ArpPreset>();
41 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
43 Kit* kit = getCurrentKit();
46 if (soundEditor.currentArpSettings->mode == ArpMode::OFF || current_value == ArpPreset::OFF) {
47 if (getCurrentClip()->isActiveOnOutput() && !soundEditor.editingKitAffectEntire()) {
52 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
53 thisDrum->arpSettings.preset = current_value;
54 thisDrum->arpSettings.updateSettingsFromCurrentPreset();
55 thisDrum->arpSettings.flagForceArpRestart =
true;
61 if (soundEditor.currentArpSettings->mode == ArpMode::OFF || current_value == ArpPreset::OFF) {
62 if (getCurrentClip()->isActiveOnOutput() && !soundEditor.editingKitAffectEntire()) {
63 char modelStackMemory[MODEL_STACK_MAX_SIZE];
66 if (soundEditor.editingKit()) {
68 Drum* currentDrum = ((
Kit*)getCurrentClip()->output)->selectedDrum;
69 if (currentDrum !=
nullptr) {
70 currentDrum->killAllVoices();
73 else if (soundEditor.editingCVOrMIDIClip()) {
74 getCurrentInstrumentClip()->stopAllNotesForMIDIOrCV(modelStack->toWithTimelineCounter());
77 ModelStackWithSoundFlags* modelStackWithSoundFlags = modelStack->addSoundFlags();
78 soundEditor.currentSound->allNotesOff(
79 modelStackWithSoundFlags,
80 soundEditor.currentSound
82 soundEditor.currentSound->reassessRenderSkippingStatus(modelStackWithSoundFlags);
87 soundEditor.currentArpSettings->preset = current_value;
88 soundEditor.currentArpSettings->updateSettingsFromCurrentPreset();
89 soundEditor.currentArpSettings->flagForceArpRestart =
true;
93 deluge::vector<std::string_view> getOptions(OptType optType)
override {
95 using enum l10n::String;
97 l10n::getView(STRING_FOR_OFF),
98 l10n::getView(STRING_FOR_UP),
99 l10n::getView(STRING_FOR_DOWN),
100 l10n::getView(STRING_FOR_BOTH),
101 l10n::getView(STRING_FOR_RANDOM),
102 l10n::getView(STRING_FOR_WALK),
103 l10n::getView(STRING_FOR_CUSTOM),
108 auto current_value = this->getValue<ArpPreset>();
109 if (current_value == ArpPreset::CUSTOM) {
110 if (soundEditor.editingKitRow()) {
111 return &arpeggiator::arpOctaveModeToNoteModeMenuForDrums;
113 return &arpeggiator::arpOctaveModeToNoteModeMenu;
Definition model_stack.h:231