Browse Source

AudioProcessor: Add isRealtime()

pull/22/head
attila 3 years ago
parent
commit
db17713aad
1 changed files with 21 additions and 0 deletions
  1. +21
    -0
      modules/juce_audio_processors/processors/juce_AudioProcessor.h

+ 21
- 0
modules/juce_audio_processors/processors/juce_AudioProcessor.h View File

@@ -71,6 +71,12 @@ public:
doublePrecision doublePrecision
}; };
enum class Realtime
{
no,
yes
};
using ChangeDetails = AudioProcessorListener::ChangeDetails; using ChangeDetails = AudioProcessorListener::ChangeDetails;
//============================================================================== //==============================================================================
@@ -916,6 +922,21 @@ public:
*/ */
bool isNonRealtime() const noexcept { return nonRealtime; } bool isNonRealtime() const noexcept { return nonRealtime; }
/** Returns no if the processor is being run in an offline mode for rendering.
If the processor is being run live on realtime signals, this returns yes.
If the mode is unknown, this will assume it's realtime and return yes.
This value may be unreliable until the prepareToPlay() method has been called,
and could change each time prepareToPlay() is called.
@see setNonRealtime()
*/
Realtime isRealtime() const noexcept
{
return isNonRealtime() ? Realtime::no : Realtime::yes;
}
/** Called by the host to tell this processor whether it's being used in a non-realtime /** Called by the host to tell this processor whether it's being used in a non-realtime
capacity for offline rendering or bouncing. capacity for offline rendering or bouncing.
*/ */


Loading…
Cancel
Save