feat: add behaviour to hp/lp filters

This commit is contained in:
2026-08-13 11:32:06 +02:00
parent a28dd890dd
commit a0c9fbb674
7 changed files with 167 additions and 174 deletions
+23 -8
View File
@@ -11,6 +11,7 @@ import {
PEQFilter,
PEQBand,
InputSource,
Crossover,
} from './types';
import { SetDsps, NotifyFn, updateDSP, setPollingPaused } from '../../dsp/dspShared';
import { registerPollStopper } from '../../dsp/pollRegistry';
@@ -1144,9 +1145,10 @@ export function forDSP408(dsp: DSP408, setDsps: SetDsps, notify: NotifyFn) {
if (!d.state) return d;
const cfg = d.state.current_config;
const lowPass = {
const lowPass: Crossover = {
frequency: freq,
filter_type: filterType,
slope: filterType,
};
if ('Input' in channel) {
@@ -1160,7 +1162,10 @@ export function forDSP408(dsp: DSP408, setDsps: SetDsps, notify: NotifyFn) {
...cfg.input_states,
[channel.Input]: {
...cfg.input_states[channel.Input],
low_pass: lowPass,
crossover: {
...cfg.input_states[channel.Input].crossover,
low_pass: lowPass,
},
},
},
},
@@ -1178,7 +1183,10 @@ export function forDSP408(dsp: DSP408, setDsps: SetDsps, notify: NotifyFn) {
...cfg.output_states,
[channel.Output]: {
...cfg.output_states[channel.Output],
low_pass: lowPass,
crossover: {
...cfg.output_states[channel.Output].crossover,
low_pass: lowPass,
},
},
},
},
@@ -1227,9 +1235,10 @@ export function forDSP408(dsp: DSP408, setDsps: SetDsps, notify: NotifyFn) {
if (!d.state) return d;
const cfg = d.state.current_config;
const highPass = {
const highPass: Crossover = {
frequency: freq,
filter_type: filterType,
slope: filterType,
};
if ('Input' in channel) {
@@ -1243,7 +1252,10 @@ export function forDSP408(dsp: DSP408, setDsps: SetDsps, notify: NotifyFn) {
...cfg.input_states,
[channel.Input]: {
...cfg.input_states[channel.Input],
high_pass: highPass,
crossover: {
...cfg.input_states[channel.Input].crossover,
high_pass: highPass,
},
},
},
},
@@ -1261,7 +1273,10 @@ export function forDSP408(dsp: DSP408, setDsps: SetDsps, notify: NotifyFn) {
...cfg.output_states,
[channel.Output]: {
...cfg.output_states[channel.Output],
high_pass: highPass,
crossover: {
...cfg.output_states[channel.Output].crossover,
high_pass: highPass,
},
},
},
},