JUCE v8.0.9
JUCE API
 
Loading...
Searching...
No Matches
juce::Thread::RealtimeOptions Struct Reference

A selection of options available when creating realtime threads. More...

#include <juce_Thread.h>

Collaboration diagram for juce::Thread::RealtimeOptions:

Public Member Functions

std::optional< double > getMaximumProcessingTimeMs () const
 Returns the maximum amount of processing time required each time the thread wakes up.
 
std::optional< double > getPeriodMs () const
 Returns the approximate amount of time between each thread wake up, or nullopt if there is no inherent periodicity.
 
int getPriority () const
 Returns a value with a range of 0-10, where 10 is the highest priority.
 
std::optional< double > getProcessingTimeMs () const
 Returns the expected amount of processing time required each time the thread wakes up.
 
RealtimeOptions withApproximateAudioProcessingTime (int samplesPerFrame, double sampleRate) const
 Specify the maximum amount of processing time required each time the thread wakes up.
 
RealtimeOptions withMaximumProcessingTimeMs (double newMaximumProcessingTimeMs) const
 Specify the maximum amount of processing time required each time the thread wakes up.
 
RealtimeOptions withPeriodHz (double newPeriodHz) const
 Specify the approximate frequency at which the thread will be woken up.
 
RealtimeOptions withPeriodMs (double newPeriodMs) const
 Specify the approximate amount of time between each thread wake up.
 
RealtimeOptions withPriority (int newPriority) const
 A value with a range of 0-10, where 10 is the highest priority.
 
RealtimeOptions withProcessingTimeMs (double newProcessingTimeMs) const
 Specify the expected amount of processing time required each time the thread wakes up.
 

Private Attributes

std::optional< double > maximumProcessingTimeMs
 
std::optional< double > periodMs {}
 
int priority { 5 }
 
std::optional< double > processingTimeMs
 

Detailed Description

A selection of options available when creating realtime threads.

See also
startRealtimeThread

Member Function Documentation

◆ getMaximumProcessingTimeMs()

std::optional< double > juce::Thread::RealtimeOptions::getMaximumProcessingTimeMs ( ) const
inline

Returns the maximum amount of processing time required each time the thread wakes up.

See also
withMaximumProcessingTimeMs, getProcessingTimeMs, getPeriodMs

◆ getPeriodMs()

std::optional< double > juce::Thread::RealtimeOptions::getPeriodMs ( ) const
inline

Returns the approximate amount of time between each thread wake up, or nullopt if there is no inherent periodicity.

See also
withPeriodMs, withPeriodHz, getProcessingTimeMs, getMaximumProcessingTimeMs

◆ getPriority()

int juce::Thread::RealtimeOptions::getPriority ( ) const
inline

Returns a value with a range of 0-10, where 10 is the highest priority.

See also
withPriority

◆ getProcessingTimeMs()

std::optional< double > juce::Thread::RealtimeOptions::getProcessingTimeMs ( ) const
inline

Returns the expected amount of processing time required each time the thread wakes up.

See also
withProcessingTimeMs, getMaximumProcessingTimeMs, getPeriodMs

◆ withApproximateAudioProcessingTime()

RealtimeOptions juce::Thread::RealtimeOptions::withApproximateAudioProcessingTime ( int  samplesPerFrame,
double  sampleRate 
) const
inline

Specify the maximum amount of processing time required each time the thread wakes up.

This is identical to 'withMaximumProcessingTimeMs' except it calculates the processing time from a sample rate and block size. This is useful if you want to run this thread in parallel to an audio device thread.

Only used by macOS/iOS.

See also
withMaximumProcessingTimeMs, AudioWorkgroup, ScopedWorkgroupToken

References jassert.

◆ withMaximumProcessingTimeMs()

RealtimeOptions juce::Thread::RealtimeOptions::withMaximumProcessingTimeMs ( double  newMaximumProcessingTimeMs) const
inline

Specify the maximum amount of processing time required each time the thread wakes up.

Only used by macOS/iOS.

See also
getMaximumProcessingTimeMs, withProcessingTimeMs, withPeriodMs, withPeriodHz

References jassert, and juce::withMember().

◆ withPeriodHz()

RealtimeOptions juce::Thread::RealtimeOptions::withPeriodHz ( double  newPeriodHz) const
inline

Specify the approximate frequency at which the thread will be woken up.

Alternatively call withPeriodMs().

Only used by macOS/iOS.

See also
getPeriodHz, withPeriodMs, withProcessingTimeMs, withMaximumProcessingTimeMs,

References jassert.

◆ withPeriodMs()

RealtimeOptions juce::Thread::RealtimeOptions::withPeriodMs ( double  newPeriodMs) const
inline

Specify the approximate amount of time between each thread wake up.

Alternatively call withPeriodHz().

Only used by macOS/iOS.

See also
getPeriodMs, withPeriodHz, withProcessingTimeMs, withMaximumProcessingTimeMs,

References jassert, and juce::withMember().

◆ withPriority()

RealtimeOptions juce::Thread::RealtimeOptions::withPriority ( int  newPriority) const
inline

A value with a range of 0-10, where 10 is the highest priority.

Currently only used by Posix platforms.

See also
getPriority

References juce::isPositiveAndNotGreaterThan(), jassert, juce::jlimit(), and juce::withMember().

◆ withProcessingTimeMs()

RealtimeOptions juce::Thread::RealtimeOptions::withProcessingTimeMs ( double  newProcessingTimeMs) const
inline

Specify the expected amount of processing time required each time the thread wakes up.

Only used by macOS/iOS.

See also
getProcessingTimeMs, withMaximumProcessingTimeMs, withPeriodMs, withPeriodHz

References jassert, and juce::withMember().

Member Data Documentation

◆ maximumProcessingTimeMs

std::optional<double> juce::Thread::RealtimeOptions::maximumProcessingTimeMs
private

◆ periodMs

std::optional<double> juce::Thread::RealtimeOptions::periodMs {}
private

◆ priority

int juce::Thread::RealtimeOptions::priority { 5 }
private

◆ processingTimeMs

std::optional<double> juce::Thread::RealtimeOptions::processingTimeMs
private

The documentation for this struct was generated from the following file: