1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

AudioWorkgroup: Update documentation

This commit is contained in:
Oliver James 2023-10-16 11:09:59 +01:00 committed by reuk
parent 5c8b7fe0e1
commit 82e1c7483e
No known key found for this signature in database
GPG key ID: FCB43929F012EE5C

View file

@ -105,21 +105,33 @@ private:
Here's an example of how you might use this class:
@code
Constructor()
{
startRealtimeThread (RealtimeThreadOptions{}.withApproximateAudioProcessingTime (samplesPerFrame, sampleRate));
or
startRealtimeThread (RealtimeThreadOptions{}.withProcessingTimeMs (10));
}
void Thread::run() override
{
WorkgroupToken token;
getWorkgroup().join (token);
while (! threadShouldExit())
while (wait (-1) && ! threadShouldExit())
{
// If the workgroup has changed, rejoin the workgroup with the same token
// If the workgroup has changed, rejoin the workgroup with the same token.
if (workgroupChanged())
getWorkgroup().join (token);
// Perform the work here
}
}
void AudioProcessor::processBlock()
{
workerThread->notify();
}
@endcode
@see Thread, AudioProcessor, WorkgroupToken