diff --git a/jam-ui/src/hooks/useMixerStore.js b/jam-ui/src/hooks/useMixerStore.js index 207e2dc01..93b71f131 100644 --- a/jam-ui/src/hooks/useMixerStore.js +++ b/jam-ui/src/hooks/useMixerStore.js @@ -13,6 +13,7 @@ import { putTrackSyncChange } from '../helpers/rest'; import useVuHelpers from './useVuHelpers'; import { useJamServerContext } from '../context/JamServerContext'; import { useMixersContext } from '../context/MixersContext'; +import { vuStore } from '../stores/vuStore'; @@ -169,21 +170,15 @@ export default function useMixerStore() { // TODO - no guarantee range will be -80 to 20. Get from the // GetControlState for this mixer which returns min/max // value is a DB value from -80 to 20. Convert to float from 0.0-1.0 - //console.log('handleBridgeCallback@mixers',@mixers) - // Use ref to get current mixerHelper (fixes stale closure issue) - const currentMixerHelper = mixerHelperRef.current; + // Convert dB to 0.0-1.0 range (existing logic) + const normalizedLevel = (leftValue + 80) / 80; - if (currentMixerHelper?.isReady.current) { - currentMixerHelper.updateVU( - mixerId, - mode, - (leftValue + 80) / 80, - leftClipping, - (rightValue + 80) / 80, - rightClipping - ); - } + // Create qualified ID matching existing pattern + const fqId = (mode ? 'M' : 'P') + mixerId; + + // Route to external store instead of mixerHelper + vuStore.updateLevel(fqId, normalizedLevel, leftClipping); } }