40 FilterInfo(FilterSlot slot_, FilterParamType type_) : slot{slot_}, type{type_} {}
41 ::FilterMode getMode()
const {
42 if (slot == FilterSlot::LPF) {
43 return soundEditor.currentModControllable->lpfMode;
46 return soundEditor.currentModControllable->hpfMode;
49 int32_t getModeValue()
const {
50 if (slot == FilterSlot::HPF) {
51 return util::to_underlying(soundEditor.currentModControllable->hpfMode) - kFirstHPFMode;
55 int32_t selection = util::to_underlying(soundEditor.currentModControllable->lpfMode);
56 return std::min(selection, kNumLPFModes);
59 void setMode(int32_t value)
const { setModeForModControllable(value, soundEditor.currentModControllable); }
61 if (slot == FilterSlot::HPF) {
62 modControllable->hpfMode =
static_cast<FilterMode
>(value + kFirstHPFMode);
66 if (value >= kNumLPFModes) {
67 modControllable->lpfMode = FilterMode::OFF;
70 modControllable->lpfMode =
static_cast<FilterMode
>(value);
74 FilterParamType getFilterParamType()
const {
return type; }
75 FilterSlot getSlot()
const {
return slot; }
78 if (type == FilterParamType::MORPH) {
79 using enum l10n::String;
81 return l10n::getView(filt.getMorphName());
87 bool isOn()
const {
return getMode() != ::FilterMode::OFF; }