Download Source/Plugin/PluginBridgeProcessor.h from RAM2118/pluginbridge: direct link, hf CLI and curl.
- Browser
- Download file 3.15 kB
-
https://huggingface.co/RAM2118/pluginbridge/resolve/ddb115bf829f00a019effbe2c307028edd9a0d27/Source/Plugin/PluginBridgeProcessor.h
- Command line
-
hf download hf://RAM2118/pluginbridge@ddb115bf829f00a019effbe2c307028edd9a0d27/Source/Plugin/PluginBridgeProcessor.h
-
curl -L -o PluginBridgeProcessor.h https://huggingface.co/RAM2118/pluginbridge/resolve/ddb115bf829f00a019effbe2c307028edd9a0d27/Source/Plugin/PluginBridgeProcessor.h
3.15 kB
| class McpServer; | |
| class PluginBridgeProcessor : public juce::AudioProcessor | |
| { | |
| public: | |
| PluginBridgeProcessor(); | |
| ~PluginBridgeProcessor() override; | |
| void prepareToPlay(double sampleRate, int samplesPerBlock) override; | |
| void releaseResources() override; | |
| void processBlock(juce::AudioBuffer<float>&, juce::MidiBuffer&) override; | |
| juce::AudioProcessorEditor* createEditor() override; | |
| bool hasEditor() const override { return true; } | |
| const juce::String getName() const override { return "PluginBridge"; } | |
| bool acceptsMidi() const override { return true; } | |
| bool producesMidi() const override { return true; } | |
| double getTailLengthSeconds() const override { return 0.0; } | |
| int getNumPrograms() override { return 1; } | |
| int getCurrentProgram() override { return 0; } | |
| void setCurrentProgram(int) override {} | |
| const juce::String getProgramName(int) override { return {}; } | |
| void changeProgramName(int, const juce::String&) override {} | |
| void getStateInformation(juce::MemoryBlock& destData) override; | |
| void setStateInformation(const void* data, int sizeInBytes) override; | |
| // MCP | |
| bool isMcpServerRunning() const; | |
| int getMcpServerPort() const; | |
| // Plugin hosting (IN-PROCESS — plugin runs inside Ableton) | |
| void loadPlugin(const juce::String& path); | |
| void unloadPlugin(); | |
| bool isPluginLoaded() const { return hostedPlugin != nullptr; } | |
| juce::String getLoadedPluginName() const; | |
| int getLoadedPluginParamCount() const; | |
| juce::String getLastPluginPath() const { return pluginPath; } | |
| // Plugin list | |
| juce::Array<juce::File> getInstalledPluginFiles() const; | |
| // Blocklist | |
| bool isBlocked(const juce::String& path) const; | |
| Blocklist& getBlocklist() { return blocklist; } | |
| // Parameter access (for MCP server) | |
| struct ParamInfo { | |
| int index; | |
| juce::String id; | |
| juce::String name; | |
| float value; | |
| juce::String displayText; | |
| }; | |
| std::vector<ParamInfo> searchParams(const juce::String& keyword) const; | |
| std::vector<std::pair<int, float>> getParams(const std::vector<int>& ids) const; | |
| bool setParams(const std::map<int, float>& values); | |
| // For editor: get hosted plugin's editor component | |
| juce::AudioProcessorEditor* createHostedPluginEditor(); | |
| // Notify editor that plugin changed | |
| std::function<void()> onPluginLoaded; | |
| std::function<void()> onPluginUnloaded; | |
| std::function<void(const juce::String&)> onLoadFailed; | |
| private: | |
| // In-process hosted plugin | |
| juce::AudioPluginFormatManager formatManager; | |
| std::unique_ptr<juce::AudioPluginInstance> hostedPlugin; | |
| juce::CriticalSection pluginLock; | |
| // MCP server | |
| std::unique_ptr<McpServer> mcpServer; | |
| // Blocklist (persisted to disk) | |
| Blocklist blocklist; | |
| // State | |
| juce::String pluginPath; | |
| double currentSampleRate = 44100.0; | |
| int currentBlockSize = 512; | |
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginBridgeProcessor) | |
| }; | |