Browse Source

Add isUsingNativeAudio() to standalone function utils

pull/321/head
falkTX 2 years ago
parent
commit
25f3562483
2 changed files with 25 additions and 3 deletions
  1. +16
    -3
      distrho/DistrhoStandaloneUtils.hpp
  2. +9
    -0
      distrho/src/jackbridge/JackBridge.cpp

+ 16
- 3
distrho/DistrhoStandaloneUtils.hpp View File

@@ -25,11 +25,24 @@ 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.
*/
@@ -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.


+ 9
- 0
distrho/src/jackbridge/JackBridge.cpp View File

@@ -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)


Loading…
Cancel
Save