Fix: HelperPluginHost.cpp use flat include for Constants.h
Browse files1234598 unmodified lines1041051061071081091101111121131141151161171181191201211221231241251261271281291301312 unmodified lines13413513613713813914014114214314414514614714814915015115215315415573 unmodified lines229230231232233234235#include "HelperPluginHost.h"#include "../Shared/Constants.h"#include <juce_audio_basics/juce_audio_basics.h>HelperPluginHost::HelperPluginHost()98 unmodified lines{if (processing.load()) return;processing.store(true);audioThread = std::thread([this]() { audioProcessingLoop(); });}void HelperPluginHost::stopProcessing(){processing.store(false);if (inputSem) inputSem->signal(); // wake thread so it can exitif (audioThread.joinable())audioThread.join();}void HelperPluginHost::audioProcessingLoop(){// Set thread to realtime priorityjuce::Thread::setCurrentThreadPriority(10);while (processing.load()){// Wait for parent to signal input is readyif (!inputSem->wait(100))continue; // timeout — check if still processingif (!processing.load()) break;if (!plugin || !sharedAudio) continue;2 unmodified linesint numChannels = header->numChannels.load();int blockSize = header->blockSize.load();// Read input from shared memory into local bufferjuce::AudioBuffer<float> buffer(numChannels, blockSize);float* channelPtrs[2] = { buffer.getWritePointer(0),numChannels > 1 ? buffer.getWritePointer(1) : nullptr };sharedAudio->readInput(channelPtrs, numChannels, blockSize);// Processjuce::MidiBuffer midi;plugin->processBlock(buffer, midi);// Write output to shared memoryconst float* constPtrs[2] = { buffer.getReadPointer(0),numChannels > 1 ? buffer.getReadPointer(1) : nullptr };sharedAudio->writeOutput(constPtrs, numChannels, blockSize);// Signal parent that output is readyheader->state.store(kStateOutputReady);outputSem->signal();}73 unmodified linesvoid HelperPluginHost::showGui(){if (!plugin || !plugin->hasEditor()) return;if (guiWindow) return; // already showingjuce::MessageManager::callAsync([this](){1234598 unmodified lines1041051061071081091101111121131141151161171181191201211221231241251261271282 unmodified lines13113213313413513613713813914014114214314414514614714873 unmodified lines222223224225226227228#include "HelperPluginHost.h"#include "Constants.h"#include <juce_audio_basics/juce_audio_basics.h>HelperPluginHost::HelperPluginHost()98 unmodified lines{if (processing.load()) return;processing.store(true);audioThread = std::thread([this]() { audioProcessingLoop(); });}void HelperPluginHost::stopProcessing(){processing.store(false);if (inputSem) inputSem->signal();if (audioThread.joinable())audioThread.join();}void HelperPluginHost::audioProcessingLoop(){juce::Thread::setCurrentThreadPriority(10);while (processing.load()){if (!inputSem->wait(100))continue;if (!processing.load()) break;if (!plugin || !sharedAudio) continue;2 unmodified linesint numChannels = header->numChannels.load();int blockSize = header->blockSize.load();juce::AudioBuffer<float> buffer(numChannels, blockSize);float* channelPtrs[2] = { buffer.getWritePointer(0),numChannels > 1 ? buffer.getWritePointer(1) : nullptr };sharedAudio->readInput(channelPtrs, numChannels, blockSize);juce::MidiBuffer midi;plugin->processBlock(buffer, midi);const float* constPtrs[2] = { buffer.getReadPointer(0),numChannels > 1 ? buffer.getReadPointer(1) : nullptr };sharedAudio->writeOutput(constPtrs, numChannels, blockSize);header->state.store(kStateOutputReady);outputSem->signal();}73 unmodified linesvoid HelperPluginHost::showGui(){if (!plugin || !plugin->hasEditor()) return;if (guiWindow) return;juce::MessageManager::callAsync([this](){
Source/Helper/HelperPluginHost.cpp+4-11