commit 25f35624837319827d40432dea07e01c54f4cba4
parent 4f981c5336c48052cdffeb463572365bf2315c37
Author: falkTX <falktx@falktx.com>
Date: Fri, 22 Jul 2022 15:38:10 +0100
Add isUsingNativeAudio() to standalone function utils
Diffstat:
2 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/distrho/DistrhoStandaloneUtils.hpp b/distrho/DistrhoStandaloneUtils.hpp
@@ -25,12 +25,25 @@ START_NAMESPACE_DISTRHO
* Standalone plugin related utilities */
/**
- @defgroup PluginRelatedUtilities Plugin related utilities
+ @defgroup StandalonePluginRelatedUtilities Plugin related utilities
+
+ When the plugin is running as standalone and JACK is not available, a native audio handling is in place.
+ It is a very simple handling, auto-connecting to the default audio interface for outputs.
+
+ !!EXPERIMENTAL!!
+
+ Still under development and testing.
@{
*/
/**
+ Check if the current standalone is using native audio methods.
+ If this function returns false, you MUST NOT use any other function from this group.
+*/
+bool isUsingNativeAudio() noexcept;
+
+/**
Check if the current standalone supports audio input.
*/
bool supportsAudioInput();
@@ -58,7 +71,7 @@ bool isMIDIEnabled();
/**
Get the current buffer size.
*/
-uint32_t getBufferSize();
+uint getBufferSize();
/**
Request permissions to use audio input.
@@ -69,7 +82,7 @@ bool requestAudioInput();
/**
Request change to a new buffer size.
*/
-bool requestBufferSizeChange(uint32_t newBufferSize);
+bool requestBufferSizeChange(uint newBufferSize);
/**
Request permissions to use MIDI.
diff --git a/distrho/src/jackbridge/JackBridge.cpp b/distrho/src/jackbridge/JackBridge.cpp
@@ -2265,6 +2265,15 @@ bool jackbridge_set_property_change_callback(jack_client_t* client, JackProperty
START_NAMESPACE_DISTRHO
+bool isUsingNativeAudio() noexcept
+{
+#if defined(JACKBRIDGE_DUMMY) || defined(JACKBRIDGE_DIRECT)
+ return false;
+#else
+ return usingNativeBridge;
+#endif
+}
+
bool supportsAudioInput()
{
#if defined(JACKBRIDGE_DUMMY)