Fix: Helper/main.cpp use flat includes (Source/Shared in include dirs)
Browse files- Source/Helper/main.cpp +3 -21
Source/Helper/main.cpp
CHANGED
|
@@ -3,20 +3,12 @@
|
|
| 3 |
#include <juce_gui_basics/juce_gui_basics.h>
|
| 4 |
#include <juce_events/juce_events.h>
|
| 5 |
|
| 6 |
-
#include "
|
| 7 |
-
#include "
|
| 8 |
-
#include "
|
| 9 |
#include "HelperPluginHost.h"
|
| 10 |
#include "HelperIPC.h"
|
| 11 |
|
| 12 |
-
// PluginBridgeHelper — standalone process that:
|
| 13 |
-
// 1. Connects to parent via Unix socket
|
| 14 |
-
// 2. Opens shared memory for audio
|
| 15 |
-
// 3. Loads third-party plugins
|
| 16 |
-
// 4. Runs processBlock when signaled
|
| 17 |
-
// 5. Shows plugin GUI in its own window
|
| 18 |
-
// 6. If it crashes, only this process dies — Ableton survives
|
| 19 |
-
|
| 20 |
class HelperApplication : public juce::JUCEApplication
|
| 21 |
{
|
| 22 |
public:
|
|
@@ -25,7 +17,6 @@ public:
|
|
| 25 |
|
| 26 |
void initialise(const juce::String& commandLine) override
|
| 27 |
{
|
| 28 |
-
// Parse args: --pid <parentPid>
|
| 29 |
auto args = juce::StringArray::fromTokens(commandLine, " ", "\"");
|
| 30 |
|
| 31 |
int parentPid = 0;
|
|
@@ -44,11 +35,9 @@ public:
|
|
| 44 |
|
| 45 |
DBG("HelperApplication: Starting for parent PID " + juce::String(parentPid));
|
| 46 |
|
| 47 |
-
// Initialize components
|
| 48 |
pluginHost = std::make_unique<HelperPluginHost>();
|
| 49 |
ipcServer = std::make_unique<HelperIPC>(parentPid, *pluginHost);
|
| 50 |
|
| 51 |
-
// Connect shared memory
|
| 52 |
auto shmName = IPC::getShmName(parentPid);
|
| 53 |
if (!sharedAudio.open(shmName))
|
| 54 |
{
|
|
@@ -57,7 +46,6 @@ public:
|
|
| 57 |
return;
|
| 58 |
}
|
| 59 |
|
| 60 |
-
// Connect semaphores
|
| 61 |
if (!inputSem.open(IPC::getInputSemName(parentPid)) ||
|
| 62 |
!outputSem.open(IPC::getOutputSemName(parentPid)))
|
| 63 |
{
|
|
@@ -66,7 +54,6 @@ public:
|
|
| 66 |
return;
|
| 67 |
}
|
| 68 |
|
| 69 |
-
// Connect IPC socket
|
| 70 |
if (!ipcServer->connect())
|
| 71 |
{
|
| 72 |
DBG("HelperApplication: Failed to connect to parent IPC socket");
|
|
@@ -74,13 +61,8 @@ public:
|
|
| 74 |
return;
|
| 75 |
}
|
| 76 |
|
| 77 |
-
// Give plugin host access to shared audio + semaphores
|
| 78 |
pluginHost->setSharedAudio(&sharedAudio, &inputSem, &outputSem);
|
| 79 |
-
|
| 80 |
-
// Start audio processing thread
|
| 81 |
pluginHost->startProcessing();
|
| 82 |
-
|
| 83 |
-
// Notify parent we're ready
|
| 84 |
ipcServer->sendReady();
|
| 85 |
|
| 86 |
DBG("HelperApplication: Ready and running");
|
|
|
|
| 3 |
#include <juce_gui_basics/juce_gui_basics.h>
|
| 4 |
#include <juce_events/juce_events.h>
|
| 5 |
|
| 6 |
+
#include "SharedAudioBuffer.h"
|
| 7 |
+
#include "IPCProtocol.h"
|
| 8 |
+
#include "Constants.h"
|
| 9 |
#include "HelperPluginHost.h"
|
| 10 |
#include "HelperIPC.h"
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
class HelperApplication : public juce::JUCEApplication
|
| 13 |
{
|
| 14 |
public:
|
|
|
|
| 17 |
|
| 18 |
void initialise(const juce::String& commandLine) override
|
| 19 |
{
|
|
|
|
| 20 |
auto args = juce::StringArray::fromTokens(commandLine, " ", "\"");
|
| 21 |
|
| 22 |
int parentPid = 0;
|
|
|
|
| 35 |
|
| 36 |
DBG("HelperApplication: Starting for parent PID " + juce::String(parentPid));
|
| 37 |
|
|
|
|
| 38 |
pluginHost = std::make_unique<HelperPluginHost>();
|
| 39 |
ipcServer = std::make_unique<HelperIPC>(parentPid, *pluginHost);
|
| 40 |
|
|
|
|
| 41 |
auto shmName = IPC::getShmName(parentPid);
|
| 42 |
if (!sharedAudio.open(shmName))
|
| 43 |
{
|
|
|
|
| 46 |
return;
|
| 47 |
}
|
| 48 |
|
|
|
|
| 49 |
if (!inputSem.open(IPC::getInputSemName(parentPid)) ||
|
| 50 |
!outputSem.open(IPC::getOutputSemName(parentPid)))
|
| 51 |
{
|
|
|
|
| 54 |
return;
|
| 55 |
}
|
| 56 |
|
|
|
|
| 57 |
if (!ipcServer->connect())
|
| 58 |
{
|
| 59 |
DBG("HelperApplication: Failed to connect to parent IPC socket");
|
|
|
|
| 61 |
return;
|
| 62 |
}
|
| 63 |
|
|
|
|
| 64 |
pluginHost->setSharedAudio(&sharedAudio, &inputSem, &outputSem);
|
|
|
|
|
|
|
| 65 |
pluginHost->startProcessing();
|
|
|
|
|
|
|
| 66 |
ipcServer->sendReady();
|
| 67 |
|
| 68 |
DBG("HelperApplication: Ready and running");
|