Download Source/Shared/IPCProtocol.h from RAM2118/pluginbridge: direct link, hf CLI and curl.
- Browser
- Download file 2.76 kB
-
https://huggingface.co/RAM2118/pluginbridge/resolve/adbb96ae3e314faf8d615e79e689a764e6739111/Source/Shared/IPCProtocol.h
- Command line
-
hf download hf://RAM2118/pluginbridge@adbb96ae3e314faf8d615e79e689a764e6739111/Source/Shared/IPCProtocol.h
-
curl -L -o IPCProtocol.h https://huggingface.co/RAM2118/pluginbridge/resolve/adbb96ae3e314faf8d615e79e689a764e6739111/Source/Shared/IPCProtocol.h
2.76 kB
| // IPC Protocol between PluginBridge (parent) and PluginBridgeHelper (child) | |
| // Transport: Unix domain socket, newline-delimited JSON messages | |
| // | |
| // Flow: | |
| // Parent → Helper: commands (load plugin, get/set params, show GUI, quit) | |
| // Helper → Parent: responses + notifications (param changes from GUI, crash) | |
| namespace IPC { | |
| // Socket path (unique per instance using PID) | |
| inline std::string getSocketPath(int parentPid) | |
| { | |
| return "/tmp/pluginbridge_" + std::to_string(parentPid) + ".sock"; | |
| } | |
| // Shared memory name (unique per instance) | |
| inline std::string getShmName(int parentPid) | |
| { | |
| return "pluginbridge_audio_" + std::to_string(parentPid); | |
| } | |
| // Semaphore names | |
| inline std::string getInputSemName(int parentPid) | |
| { | |
| return "pb_input_" + std::to_string(parentPid); | |
| } | |
| inline std::string getOutputSemName(int parentPid) | |
| { | |
| return "pb_output_" + std::to_string(parentPid); | |
| } | |
| // --- Message Types (Parent → Helper) --- | |
| // Load a plugin by file path | |
| // {"cmd":"load","path":"/Library/Audio/Plug-Ins/VST3/Pro-Q 4.vst3"} | |
| // Response: {"ok":true,"name":"Pro-Q 4","params":737} or {"ok":false,"error":"..."} | |
| // Unload current plugin | |
| // {"cmd":"unload"} | |
| // Response: {"ok":true} | |
| // Search parameters by keyword | |
| // {"cmd":"search_param","keyword":"gain"} | |
| // Response: {"ok":true,"results":[{"i":12,"n":"Band 1 Gain","v":0.5,"t":"0.0 dB"},...]} | |
| // Get parameter values by index | |
| // {"cmd":"get_params","ids":[12,13,14]} | |
| // Response: {"ok":true,"values":{"12":0.5,"13":0.7,"14":0.0}} | |
| // Set parameter values | |
| // {"cmd":"set_params","values":{"12":0.75,"13":0.3}} | |
| // Response: {"ok":true} | |
| // Show/hide plugin GUI | |
| // {"cmd":"show_gui"} | |
| // {"cmd":"hide_gui"} | |
| // Response: {"ok":true} | |
| // Get plugin state (for save) | |
| // {"cmd":"get_state"} | |
| // Response: {"ok":true,"state":"<base64-encoded state>"} | |
| // Set plugin state (for restore) | |
| // {"cmd":"set_state","state":"<base64-encoded state>"} | |
| // Response: {"ok":true} | |
| // Configure audio | |
| // {"cmd":"configure","sampleRate":44100,"blockSize":512,"channels":2} | |
| // Response: {"ok":true} | |
| // Quit helper | |
| // {"cmd":"quit"} | |
| // No response (process exits) | |
| // --- Message Types (Helper → Parent, unsolicited notifications) --- | |
| // Parameter changed from GUI interaction | |
| // {"notify":"param_changed","index":12,"value":0.75} | |
| // Plugin crashed (sent if helper catches it before dying) | |
| // {"notify":"crashed","error":"..."} | |
| // Helper ready (sent after startup) | |
| // {"notify":"ready"} | |
| // --- Constants --- | |
| static constexpr int kMaxMessageSize = 65536; // 64KB max for state blobs | |
| static constexpr int kHelperTimeoutMs = 5000; // 5s to start up | |
| static constexpr int kProcessBlockTimeoutMs = 50; // 50ms max wait in processBlock | |
| } // namespace IPC | |