26#if (JUCE_PLUGINHOST_ARA && (JUCE_PLUGINHOST_VST3 || JUCE_PLUGINHOST_AU) && (JUCE_MAC || JUCE_WINDOWS))
28#include <ARA_Library/Debug/ARADebug.h>
33static void dummyARAInterfaceAssert (ARA::ARAAssertCategory,
const void*,
const char*)
36static ARA::ARAInterfaceConfiguration createInterfaceConfig (
const ARA::ARAFactory* araFactory)
38 static auto* assertFunction = &dummyARAInterfaceAssert;
40 #if ARA_VALIDATE_API_CALLS
41 assertFunction = &::ARA::ARAInterfaceAssert;
42 static std::once_flag
flag;
43 std::call_once (
flag, [] { ARA::ARASetExternalAssertReference (&assertFunction); });
47 jmin (araFactory->highestSupportedApiGeneration, (ARA::ARAAPIGeneration) ARA::kARAAPIGeneration_2_X_Draft),
51static std::shared_ptr<const ARA::ARAFactory> getOrCreateARAFactory (
const ARA::ARAFactory* ptr,
52 std::function<
void (
const ARA::ARAFactory*)> onDelete)
56 static std::unordered_map<const ARA::ARAFactory*, std::weak_ptr<const ARA::ARAFactory>> cache;
58 auto& cachePtr = cache[
ptr];
60 if (
const auto obj = cachePtr.lock())
63 const auto interfaceConfig = createInterfaceConfig (ptr);
64 ptr->initializeARAWithConfiguration (&interfaceConfig);
65 const auto obj = std::shared_ptr<const ARA::ARAFactory> (ptr, [deleter = std::move (onDelete)] (
const ARA::ARAFactory* factory)
67 factory->uninitializeARA();
Type jmin(const Type a, const Type b)
Definition MathsFunctions.h:60
#define JUCE_ASSERT_MESSAGE_THREAD
Definition juce_MessageManager.h:473
struct Steinberg::Singleton::Deleter deleter
Definition carla_juce.cpp:31
constexpr Obj makeARASizedStruct(Member Obj::*member, Ts &&... ts)
Definition juce_ARACommon.h:79
jack_client_t client jack_client_t client jack_client_t client jack_client_t JackInfoShutdownCallback void arg jack_client_t jack_port_t port void func jack_client_t const char const char unsigned long flags const jack_port_t port jack_client_t jack_port_id_t port_id const jack_port_t const char port_name const jack_port_t port void * ptr
Definition juce_linux_JackAudio.cpp:79
int flag
Definition unix.c:754