RAM2118 commited on
Commit
644b727
·
verified ·
1 Parent(s): 2871daa

Out-of-process rebuild: Add Plugin/PluginBridgeProcessor.h/.cpp — uses HelperConnection for crash-safe hosting

Browse files
Source/Plugin/PluginBridgeProcessor.h ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #pragma once
2
+
3
+ #include <juce_audio_processors/juce_audio_processors.h>
4
+ #include <juce_dsp/juce_dsp.h>
5
+ #include "HelperConnection.h"
6
+ #include "McpServer.h"
7
+ #include "../Shared/Constants.h"
8
+
9
+ class PluginBridgeProcessor : public juce::AudioProcessor
10
+ {
11
+ public:
12
+ PluginBridgeProcessor();
13
+ ~PluginBridgeProcessor() override;
14
+
15
+ void prepareToPlay(double sampleRate, int samplesPerBlock) override;
16
+ void releaseResources() override;
17
+ void processBlock(juce::AudioBuffer<float>&, juce::MidiBuffer&) override;
18
+
19
+ juce::AudioProcessorEditor* createEditor() override;
20
+ bool hasEditor() const override { return true; }
21
+
22
+ const juce::String getName() const override { return "PluginBridge"; }
23
+ bool acceptsMidi() const override { return true; }
24
+ bool producesMidi() const override { return true; }
25
+ double getTailLengthSeconds() const override { return 0.0; }
26
+
27
+ int getNumPrograms() override { return 1; }
28
+ int getCurrentProgram() override { return 0; }
29
+ void setCurrentProgram(int) override {}
30
+ const juce::String getProgramName(int) override { return {}; }
31
+ void changeProgramName(int, const juce::String&) override {}
32
+
33
+ void getStateInformation(juce::MemoryBlock& destData) override;
34
+ void setStateInformation(const void* data, int sizeInBytes) override;
35
+
36
+ // Public access for Editor and McpServer
37
+ bool isMcpServerRunning() const;
38
+ int getMcpServerPort() const;
39
+ HelperConnection& getHelperConnection() { return helper; }
40
+
41
+ // Load/unload plugin (routes through helper process)
42
+ void loadPlugin(const juce::String& pluginPath);
43
+ void unloadPlugin();
44
+ void showPluginGui();
45
+
46
+ // Plugin state
47
+ bool isPluginLoaded() const { return pluginLoaded; }
48
+ juce::String getLoadedPluginName() const { return pluginName; }
49
+ int getLoadedPluginParamCount() const { return pluginParamCount; }
50
+ HelperConnection::State getConnectionState() const { return helper.getState(); }
51
+
52
+ // Plugin file listing (safe — no binary loading)
53
+ juce::Array<juce::File> getInstalledPluginFiles() const;
54
+
55
+ private:
56
+ HelperConnection helper;
57
+ McpServer mcpServer;
58
+
59
+ bool pluginLoaded = false;
60
+ juce::String pluginName;
61
+ juce::String pluginPath;
62
+ int pluginParamCount = 0;
63
+
64
+ double currentSampleRate = 44100.0;
65
+ int currentBlockSize = 512;
66
+
67
+ JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(PluginBridgeProcessor)
68
+ };