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),
60 void getColumnLabel(StringBuf& label)
override {
61 label.append(deluge::l10n::get(deluge::l10n::built_in::seven_segment, this->
name));
65 bool isToggle()
override {
return true; }
70 void renderInHorizontalMenu(int32_t startX, int32_t width, int32_t startY, int32_t height)
override {
71 using namespace deluge::hid::display;
72 const auto iconBitmap = this->getValue() ? &OLED::switcherIconOn : &OLED::switcherIconOff;
75 constexpr int32_t numBytesTall = 2;
76 constexpr int32_t iconHeight = numBytesTall * 8;
77 const int32_t iconWidth = iconBitmap->
size() / numBytesTall;
78 const int32_t x = startX + (width - iconWidth) / 2 - 1;
79 image.drawGraphicMultiLine(iconBitmap->data(), x, startY, iconWidth, iconHeight, numBytesTall);