Download Source/PluginBridgeProcessor.cpp from RAM2118/pluginbridge: direct link, hf CLI and curl.
- Browser
- Download file 2.15 kB
-
https://huggingface.co/RAM2118/pluginbridge/resolve/e99e9f97e97304dfd53cbc1ec4634ede3563ffb9/Source/PluginBridgeProcessor.cpp
- Command line
-
hf download hf://RAM2118/pluginbridge@e99e9f97e97304dfd53cbc1ec4634ede3563ffb9/Source/PluginBridgeProcessor.cpp
-
curl -L -o PluginBridgeProcessor.cpp https://huggingface.co/RAM2118/pluginbridge/resolve/e99e9f97e97304dfd53cbc1ec4634ede3563ffb9/Source/PluginBridgeProcessor.cpp
2.15 kB
| PluginBridgeProcessor::PluginBridgeProcessor() | |
| : AudioProcessor(BusesProperties() | |
| .withInput("Input", juce::AudioChannelSet::stereo(), true) | |
| .withOutput("Output", juce::AudioChannelSet::stereo(), true)), | |
| mcpServer(kDefaultMcpPort) | |
| { | |
| // Start MCP server in background thread | |
| mcpServer.start(); | |
| } | |
| PluginBridgeProcessor::~PluginBridgeProcessor() | |
| { | |
| mcpServer.stop(); | |
| } | |
| void PluginBridgeProcessor::prepareToPlay(double /*sampleRate*/, int /*samplesPerBlock*/) | |
| { | |
| // Phase 2: prepare hosted plugin + analyser here | |
| } | |
| void PluginBridgeProcessor::releaseResources() | |
| { | |
| // Phase 2: release hosted plugin + analyser here | |
| } | |
| void PluginBridgeProcessor::processBlock(juce::AudioBuffer<float>& buffer, | |
| juce::MidiBuffer& /*midiMessages*/) | |
| { | |
| juce::ScopedNoDenormals noDenormals; | |
| // Clear any extra output channels | |
| auto totalNumInputChannels = getTotalNumInputChannels(); | |
| auto totalNumOutputChannels = getTotalNumOutputChannels(); | |
| for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i) | |
| buffer.clear(i, 0, buffer.getNumSamples()); | |
| // Sprint 1: Pure passthrough — audio goes in, audio goes out unchanged | |
| // Phase 2: analyser.processBlock(buffer) | |
| // Phase 2: hostedPlugin->processBlock(buffer, midi) | |
| } | |
| juce::AudioProcessorEditor* PluginBridgeProcessor::createEditor() | |
| { | |
| return new PluginBridgeEditor(*this); | |
| } | |
| void PluginBridgeProcessor::getStateInformation(juce::MemoryBlock& /*destData*/) | |
| { | |
| // Phase 2: save which plugin is loaded + its state | |
| } | |
| void PluginBridgeProcessor::setStateInformation(const void* /*data*/, int /*sizeInBytes*/) | |
| { | |
| // Phase 2: restore hosted plugin from saved state | |
| } | |
| bool PluginBridgeProcessor::isMcpServerRunning() const | |
| { | |
| return mcpServer.isRunning(); | |
| } | |
| int PluginBridgeProcessor::getMcpServerPort() const | |
| { | |
| return mcpServer.getPort(); | |
| } | |
| // JUCE plugin entry point | |
| juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() | |
| { | |
| return new PluginBridgeProcessor(); | |
| } | |