wire AudioAnalyser: prepareToPlay + processBlock + MCP callback (3 additions)
Browse files21 unmodified lines2223242526272811 unmodified lines4041424344458 unmodified lines54555657585953 unmodified lines11311411511611711855 unmodified lines17417517617717817918021 unmodified linesDBG("PluginBridgeProcessor: Helper crashed");};// When helper sends "ready" notification with layer port infohelper.onGuiReady = [this](const juce::String& portName, int width, int height){remoteLayerPortName = portName;11 unmodified linesjuce::MessageManager::callAsync([this, width, height]() { if (onGuiResized) onGuiResized(width, height); });};mcpServer->start();}8 unmodified linescurrentSampleRate = sampleRate;currentBlockSize = samplesPerBlock;if (helper.isHelperRunning()){json cmd = {{"cmd", "configure"},53 unmodified lines};shm.readOutput(outputPtrs, numChannels, numSamples);header->state.store(kStateIdle);}}55 unmodified lines{pluginLoaded = false;auto error = juce::String(j.value("error", "unknown"));// If plugin failed in helper, blocklist itblocklist.addBlocked(path);if (onLoadFailed)onLoadFailed("Not compatible: " + error);21 unmodified lines22232425262711 unmodified lines3940414243444546478 unmodified lines56575859606162636453 unmodified lines11811912012112212312412512655 unmodified lines18218318418518618721 unmodified linesDBG("PluginBridgeProcessor: Helper crashed");};helper.onGuiReady = [this](const juce::String& portName, int width, int height){remoteLayerPortName = portName;11 unmodified linesjuce::MessageManager::callAsync([this, width, height]() { if (onGuiResized) onGuiResized(width, height); });};// Wire audio analysis to MCP get_analysis toolmcpServer->getAnalysisCallback = [this]() { return analyser.getCompactAnalysis(); };mcpServer->start();}8 unmodified linescurrentSampleRate = sampleRate;currentBlockSize = samplesPerBlock;// Prepare audio analyseranalyser.prepareToPlay(sampleRate, samplesPerBlock);if (helper.isHelperRunning()){json cmd = {{"cmd", "configure"},53 unmodified lines};shm.readOutput(outputPtrs, numChannels, numSamples);header->state.store(kStateIdle);// Analyse the output audio (post-plugin processing)analyser.processBlock(buffer);}}55 unmodified lines{pluginLoaded = false;auto error = juce::String(j.value("error", "unknown"));blocklist.addBlocked(path);if (onLoadFailed)onLoadFailed("Not compatible: " + error);
Source/Plugin/PluginBridgeProcessor.cpp+9-2