modularity

This commit is contained in:
2025-09-30 14:20:50 +02:00
parent c16b3738ea
commit 304627b248
26 changed files with 892 additions and 198 deletions

View File

@ -1,4 +1,5 @@
import { ENGINE_CONTROLS, SAMPLE_RATES, getComplexityLabel } from '../config/effects'
import { ENGINE_CONTROLS } from '../config/effects'
import { getComplexityLabel, getBitDepthLabel, getSampleRateLabel } from '../utils/formatters'
import type { EffectValues } from '../types/effects'
interface EngineControlsProps {
@ -10,9 +11,11 @@ export function EngineControls({ values, onChange }: EngineControlsProps) {
const formatValue = (id: string, value: number): string => {
switch (id) {
case 'sampleRate':
return `${SAMPLE_RATES[value]}Hz`
return getSampleRateLabel(value)
case 'complexity':
return getComplexityLabel(value)
case 'bitDepth':
return getBitDepthLabel(value)
default:
const param = ENGINE_CONTROLS[0].parameters.find(p => p.id === id)
return `${value}${param?.unit || ''}`