Download Source/HostedPluginManager.h from RAM2118/pluginbridge: direct link, hf CLI and curl.
- Browser
- Download file 1.7 kB
-
https://huggingface.co/RAM2118/pluginbridge/resolve/ef289db086dedc99fa84dcfd82a53f9dbde4c007/Source/HostedPluginManager.h
- Command line
-
hf download hf://RAM2118/pluginbridge@ef289db086dedc99fa84dcfd82a53f9dbde4c007/Source/HostedPluginManager.h
-
curl -L -o HostedPluginManager.h https://huggingface.co/RAM2118/pluginbridge/resolve/ef289db086dedc99fa84dcfd82a53f9dbde4c007/Source/HostedPluginManager.h
1.7 kB
| class HostedPluginManager | |
| { | |
| public: | |
| HostedPluginManager(); | |
| ~HostedPluginManager(); | |
| // Plugin lifecycle | |
| void loadPlugin(const juce::File& pluginFile, double sampleRate, int blockSize); | |
| void unloadPlugin(); | |
| bool isLoaded() const; | |
| juce::String getPluginName() const; | |
| // Audio processing — called from audio thread | |
| void prepareToPlay(double sampleRate, int blockSize); | |
| void processBlock(juce::AudioBuffer<float>& buffer, juce::MidiBuffer& midi); | |
| void releaseResources(); | |
| // Parameter surface — called from HTTP thread (thread-safe) | |
| struct ParamInfo { | |
| int index; | |
| juce::String id; | |
| juce::String name; | |
| float value; // 0.0–1.0 normalized | |
| juce::String displayText; | |
| bool automatable; | |
| }; | |
| std::vector<ParamInfo> searchParams(const juce::String& keyword) const; | |
| std::vector<std::pair<int, float>> getParams(const std::vector<int>& indices) const; | |
| bool setParams(const std::map<int, float>& values); | |
| int getParameterCount() const; | |
| // Thread safety | |
| juce::CriticalSection& getPluginLock() { return pluginLock; } | |
| // File path of currently loaded plugin (for state save/restore) | |
| juce::String getLoadedPluginPath() const; | |
| private: | |
| juce::AudioPluginFormatManager formatManager; | |
| std::unique_ptr<juce::AudioPluginInstance> hostedPlugin; | |
| juce::CriticalSection pluginLock; | |
| double currentSampleRate = 44100.0; | |
| int currentBlockSize = 512; | |
| juce::String loadedPluginPath; | |
| JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(HostedPluginManager) | |
| }; | |