commit f412918c5f4022f074663abf86877a67f9d9a421
parent d41b971d77dceadcb76a7736908d0b6a36ff1469
Author: falkTX <falktx@falktx.com>
Date: Wed, 27 Jul 2022 04:16:19 +0100
A few more tweaks for native-audio standalone, allow forcing
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
5 files changed, 28 insertions(+), 29 deletions(-)
diff --git a/Makefile.base.mk b/Makefile.base.mk
@@ -346,7 +346,9 @@ endif
endif
# backwards compat, always available/enabled
+ifneq ($(FORCE_NATIVE_AUDIO_FALLBACK),true)
HAVE_JACK = true
+endif
# ---------------------------------------------------------------------------------------------------------------------
# Set Generic DGL stuff
diff --git a/Makefile.plugins.mk b/Makefile.plugins.mk
@@ -88,13 +88,16 @@ JACK_LIBS += -lole32 -lwinmm
JACK_LIBS += -ldsound
# WASAPI
# JACK_LIBS += -lksuser -lmfplat -lmfuuid -lwmcodecdspuuid
-else ifeq ($(HAVE_PULSEAUDIO),true)
+else
+ifeq ($(HAVE_PULSEAUDIO),true)
JACK_FLAGS += $(PULSEAUDIO_FLAGS)
JACK_LIBS += $(PULSEAUDIO_LIBS)
-else ifeq ($(HAVE_ALSA),true)
+endif
+ifeq ($(HAVE_ALSA),true)
JACK_FLAGS += $(ALSA_FLAGS)
JACK_LIBS += $(ALSA_LIBS)
endif
+endif
ifeq ($(HAVE_RTAUDIO),true)
ifneq ($(HAIKU),true)
diff --git a/distrho/src/DistrhoPluginJACK.cpp b/distrho/src/DistrhoPluginJACK.cpp
@@ -31,7 +31,7 @@
# include "../extra/Thread.hpp"
#endif
-#if defined(STATIC_BUILD) && !defined(DISTRHO_OS_WASM)
+#if defined(HAVE_JACK) && defined(STATIC_BUILD) && !defined(DISTRHO_OS_WASM)
# define JACKBRIDGE_DIRECT
#endif
diff --git a/distrho/src/jackbridge/JackBridge.cpp b/distrho/src/jackbridge/JackBridge.cpp
@@ -441,8 +441,7 @@ struct JackBridge {
, set_thread_creator_ptr(nullptr)
#endif
{
- #ifdef DISTRHO_OS_WASM
- // never use jack in wasm
+ #ifndef HAVE_JACK
return;
#endif
@@ -2284,13 +2283,11 @@ bool isUsingNativeAudio() noexcept
bool supportsAudioInput()
{
-#if defined(JACKBRIDGE_DUMMY)
- return false;
-#elif !defined(JACKBRIDGE_DIRECT)
+#if !(defined(JACKBRIDGE_DUMMY) || defined(JACKBRIDGE_DIRECT))
if (usingNativeBridge)
return nativeBridge->supportsAudioInput();
#endif
- return true;
+ return false;
}
bool supportsBufferSizeChanges()
@@ -2304,35 +2301,29 @@ bool supportsBufferSizeChanges()
bool supportsMIDI()
{
-#if defined(JACKBRIDGE_DUMMY)
- return false;
-#elif !defined(JACKBRIDGE_DIRECT)
+#if !(defined(JACKBRIDGE_DUMMY) || defined(JACKBRIDGE_DIRECT))
if (usingNativeBridge)
return nativeBridge->supportsMIDI();
#endif
- return true;
+ return false;
}
bool isAudioInputEnabled()
{
-#if defined(JACKBRIDGE_DUMMY)
- return false;
-#elif !defined(JACKBRIDGE_DIRECT)
+#if !(defined(JACKBRIDGE_DUMMY) || defined(JACKBRIDGE_DIRECT))
if (usingNativeBridge)
return nativeBridge->isAudioInputEnabled();
#endif
- return true;
+ return false;
}
bool isMIDIEnabled()
{
-#if defined(JACKBRIDGE_DUMMY)
- return false;
-#elif !defined(JACKBRIDGE_DIRECT)
+#if !(defined(JACKBRIDGE_DUMMY) || defined(JACKBRIDGE_DIRECT))
if (usingNativeBridge)
return nativeBridge->isMIDIEnabled();
#endif
- return true;
+ return false;
}
uint getBufferSize()
diff --git a/distrho/src/jackbridge/RtAudioBridge.hpp b/distrho/src/jackbridge/RtAudioBridge.hpp
@@ -31,14 +31,17 @@
# define __WINDOWS_DS__
# define RTAUDIO_API_TYPE WINDOWS_DS
# define RTMIDI_API_TYPE WINDOWS_MM
-#elif defined(HAVE_PULSEAUDIO)
-# define __LINUX_PULSE__
-# define RTAUDIO_API_TYPE LINUX_PULSE
-# define RTMIDI_API_TYPE LINUX_ALSA
-#elif defined(HAVE_ALSA)
-# define __LINUX_ALSA__
-# define RTAUDIO_API_TYPE LINUX_ALSA
-# define RTMIDI_API_TYPE LINUX_ALSA
+#else
+# if defined(HAVE_PULSEAUDIO)
+# define __LINUX_PULSE__
+# define RTAUDIO_API_TYPE LINUX_PULSE
+# elif defined(HAVE_ALSA)
+# define __LINUX_ALSA__
+ # define RTAUDIO_API_TYPE LINUX_ALSA
+# endif
+# ifdef HAVE_ALSA
+# define RTMIDI_API_TYPE LINUX_ALSA
+# endif
#endif
#ifdef RTAUDIO_API_TYPE