import { ENGINE_CONTROLS } from '../config/effects' import { getComplexityLabel, getBitDepthLabel, getSampleRateLabel } from '../utils/formatters' import type { EffectValues } from '../types/effects' import { Knob } from './Knob' interface EngineControlsProps { values: EffectValues onChange: (parameterId: string, value: number) => void onMapClick?: (paramId: string, lfoIndex: number) => void getMappedLFOs?: (paramId: string) => number[] } const KNOB_PARAMS = ['masterVolume', 'pitch', 'a', 'b', 'c', 'd'] export function EngineControls({ values, onChange, onMapClick, getMappedLFOs }: EngineControlsProps) { const formatValue = (id: string, value: number): string => { switch (id) { case 'sampleRate': 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 || ''}` } } } return (