Out-of-process rebuild: Add Helper/HelperIPC.h/.cpp — Unix socket IPC listener
Browse files- Source/Helper/HelperIPC.h +33 -0
Source/Helper/HelperIPC.h
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#pragma once
|
| 2 |
+
|
| 3 |
+
#include <juce_core/juce_core.h>
|
| 4 |
+
#include <thread>
|
| 5 |
+
#include <atomic>
|
| 6 |
+
#include <functional>
|
| 7 |
+
|
| 8 |
+
class HelperPluginHost;
|
| 9 |
+
|
| 10 |
+
class HelperIPC
|
| 11 |
+
{
|
| 12 |
+
public:
|
| 13 |
+
HelperIPC(int parentPid, HelperPluginHost& host);
|
| 14 |
+
~HelperIPC();
|
| 15 |
+
|
| 16 |
+
bool connect();
|
| 17 |
+
void disconnect();
|
| 18 |
+
|
| 19 |
+
void sendReady();
|
| 20 |
+
void sendParamChanged(int index, float value);
|
| 21 |
+
|
| 22 |
+
private:
|
| 23 |
+
void listenLoop();
|
| 24 |
+
void handleMessage(const juce::String& message);
|
| 25 |
+
void sendMessage(const juce::String& json);
|
| 26 |
+
|
| 27 |
+
int parentPid;
|
| 28 |
+
HelperPluginHost& host;
|
| 29 |
+
|
| 30 |
+
int socketFd = -1;
|
| 31 |
+
std::thread listenThread;
|
| 32 |
+
std::atomic<bool> running{false};
|
| 33 |
+
};
|