41 FilterInfo(FilterSlot slot_, FilterParamType type_) : slot{slot_}, type{type_} {}
42 ::FilterMode getMode()
const {
43 if (slot == FilterSlot::LPF) {
44 return soundEditor.currentModControllable->lpfMode;
47 return soundEditor.currentModControllable->hpfMode;
50 int32_t getModeValue()
const {
51 if (slot == FilterSlot::HPF) {
52 return util::to_underlying(soundEditor.currentModControllable->hpfMode) - kFirstHPFMode;
56 int32_t selection = util::to_underlying(soundEditor.currentModControllable->lpfMode);
57 return std::min(selection, kNumLPFModes);
60 void setMode(int32_t value)
const { setModeForModControllable(value, soundEditor.currentModControllable); }
62 if (slot == FilterSlot::HPF) {
63 modControllable->hpfMode =
static_cast<FilterMode
>(value + kFirstHPFMode);
67 if (value >= kNumLPFModes) {
68 modControllable->lpfMode = FilterMode::OFF;
71 modControllable->lpfMode =
static_cast<FilterMode
>(value);
75 FilterParamType getFilterParamType()
const {
return type; }
76 FilterSlot getSlot()
const {
return slot; }
78 [[nodiscard]] std::string_view
getMorphNameOr(std::string_view alt,
bool shortName =
false)
const {
79 if (type == FilterParamType::MORPH) {
80 using enum l10n::String;
82 return l10n::getView(filt.getMorphName(shortName));
86 [[nodiscard]]
bool isMorphable()
const {
88 return filter.getFamily() == dsp::filter::FilterFamily::SVF;
91 bool isOn()
const {
return getMode() != ::FilterMode::OFF; }