28 using Selection::Selection;
29 enum Kind { SONG, DEFAULT };
30 ThresholdMode(deluge::l10n::String newName, Kind kind_) :
Selection(newName), kind(kind_) {}
34 if (kind == DEFAULT) {
35 this->setValue(FlashStorage::defaultThresholdRecordingMode);
37 else if (currentSong) {
38 this->setValue(currentSong->thresholdRecordingMode);
42 void writeCurrentValue()
override {
43 if (kind == DEFAULT) {
44 FlashStorage::defaultThresholdRecordingMode = this->getValue<ThresholdRecordingMode>();
47 currentSong->thresholdRecordingMode = this->getValue<ThresholdRecordingMode>();
51 deluge::vector<std::string_view> getOptions(OptType optType)
override {
53 using enum l10n::String;
55 l10n::getView(STRING_FOR_DISABLED),
56 l10n::getView(STRING_FOR_LOW),
57 l10n::getView(STRING_FOR_MEDIUM),
58 l10n::getView(STRING_FOR_HIGH),