18#include "gui/l10n/strings.h"
19#include "gui/menu_item/selection.h"
20#include "gui/ui/sound_editor.h"
21#include "model/drum/drum.h"
22#include "model/instrument/kit.h"
23#include "model/song/song.h"
24#include "processing/sound/sound.h"
26namespace deluge::gui::menu_item::arpeggiator {
29 using Selection::Selection;
30 void readCurrentValue()
override { this->setValue(soundEditor.currentArpSettings->randomizerLock); }
33 void writeCurrentValue()
override {
34 bool current_value = this->getValue() != 0;
37 if (currentUIMode == UI_MODE_HOLDING_AFFECT_ENTIRE_IN_SOUND_EDITOR && soundEditor.editingKitRow()) {
39 Kit* kit = getCurrentKit();
41 for (
Drum* thisDrum = kit->firstDrum; thisDrum !=
nullptr; thisDrum = thisDrum->next) {
42 thisDrum->arpSettings.randomizerLock = current_value;
47 soundEditor.currentArpSettings->randomizerLock = current_value;
51 deluge::vector<std::string_view> getOptions(OptType optType)
override {
53 using enum l10n::String;
55 l10n::getView(STRING_FOR_OFF),
56 l10n::getView(STRING_FOR_ON),
61 label.append(deluge::l10n::get(deluge::l10n::built_in::seven_segment, this->name));
65 bool isToggle()
override {
return true; }
Definition d_string.h:106
Definition randomizer_lock.h:27
void getColumnLabel(StringBuf &label) override
Get the name for use on horizontal menus.
Definition randomizer_lock.h:60
void readCurrentValue() override
Like readValueAgain, but does not redraw.
Definition randomizer_lock.h:30
bool usesAffectEntire() override
Claim support for Kit AFFECT_ENTIRE editing.
Definition randomizer_lock.h:32
bool shouldEnterSubmenu() override
Check if selecting this menu item (with select encoder) should enter a submenu.
Definition randomizer_lock.h:68