25 using Selection::Selection;
28 this->setValue(scaleToOptionIndex(flashStorageCodeToScale(FlashStorage::defaultScale)));
31 void writeCurrentValue()
override {
32 FlashStorage::defaultScale = scaleToFlashStorageCode(optionIndexToScale(
static_cast<Scale
>(this->getValue())));
37 deluge::vector<std::string_view> getOptions(OptType optType)
override {
39 deluge::vector<std::string_view> scales;
40 for (uint8_t i = 0; i < NUM_SCALELIKE; i++) {
41 if (i != USER_SCALE) {
42 scales.push_back(scalelikeNames[i]);
51 Scale optionIndexToScale(uint8_t index) {
52 if (index >= USER_SCALE) {
55 return static_cast<Scale
>(index);
57 uint8_t scaleToOptionIndex(Scale scale) {
58 if (scale >= USER_SCALE) {