2024-10-27 14:30:39 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <JuceHeader.h>
|
|
|
|
#include "../shape/OsciPoint.h"
|
|
|
|
|
|
|
|
|
|
|
|
class AudioBackgroundThread;
|
|
|
|
class AudioBackgroundThreadManager {
|
|
|
|
public:
|
|
|
|
AudioBackgroundThreadManager() {}
|
|
|
|
~AudioBackgroundThreadManager() {}
|
|
|
|
|
|
|
|
void registerThread(AudioBackgroundThread* thread);
|
|
|
|
void unregisterThread(AudioBackgroundThread* thread);
|
|
|
|
void write(const OsciPoint& point);
|
2025-01-07 12:27:39 +00:00
|
|
|
void write(const OsciPoint& point, juce::String name);
|
2024-10-27 14:30:39 +00:00
|
|
|
void prepare(double sampleRate, int samplesPerBlock);
|
|
|
|
|
|
|
|
double sampleRate = 44100.0;
|
|
|
|
int samplesPerBlock = 128;
|
|
|
|
|
|
|
|
private:
|
|
|
|
juce::SpinLock lock;
|
|
|
|
std::vector<AudioBackgroundThread*> threads;
|
|
|
|
};
|