diff --git a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp index 6483a04098a..cf23c564439 100644 --- a/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp +++ b/modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp @@ -94,7 +94,7 @@ void AudioIODeviceType::callDeviceChangeListeners() AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return nullptr; } #endif -#if (JUCE_LINUX || JUCE_BSD) && JUCE_JACK +#if (JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_WINDOWS) && JUCE_JACK AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return new JackAudioIODeviceType(); } #else AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return nullptr; } diff --git a/modules/juce_audio_devices/juce_audio_devices.cpp b/modules/juce_audio_devices/juce_audio_devices.cpp index 76e219af490..d6410c69404 100644 --- a/modules/juce_audio_devices/juce_audio_devices.cpp +++ b/modules/juce_audio_devices/juce_audio_devices.cpp @@ -164,19 +164,6 @@ #include "native/juce_ALSA_linux.cpp" #endif - #if JUCE_JACK - /* Got an include error here? If so, you've either not got jack-audio-connection-kit - installed, or you've not got your paths set up correctly to find its header files. - - The package you need to install to get JACK support is "libjack-dev". - - If you don't have the jack-audio-connection-kit library and don't want to build - JUCE with low latency audio support, just set the JUCE_JACK flag to 0. - */ - #include - #include "native/juce_JackAudio_linux.cpp" - #endif - #if (JUCE_LINUX && JUCE_BELA) /* Got an include error here? If so, you've either not got the bela headers installed, or you've not got your paths set up correctly to find its header @@ -246,6 +233,20 @@ namespace juce #endif +//============================================================================== +#if (JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_WINDOWS) && JUCE_JACK + /* Got an include error here? If so, you've either not got jack-audio-connection-kit + installed, or you've not got your paths set up correctly to find its header files. + + The package you need to install to get JACK support is "libjack-dev". + + If you don't have the jack-audio-connection-kit library and don't want to build + JUCE with low latency audio support, just set the JUCE_JACK flag to 0. + */ + #include + #include "native/juce_JackAudio.cpp" +#endif + #if ! JUCE_SYSTEMAUDIOVOL_IMPLEMENTED namespace juce { diff --git a/modules/juce_audio_devices/juce_audio_devices.h b/modules/juce_audio_devices/juce_audio_devices.h index 8998451a2e1..bafbd2e2e49 100644 --- a/modules/juce_audio_devices/juce_audio_devices.h +++ b/modules/juce_audio_devices/juce_audio_devices.h @@ -110,7 +110,7 @@ #endif /** Config: JUCE_JACK - Enables JACK audio devices (Linux only). + Enables JACK audio devices. */ #ifndef JUCE_JACK #define JUCE_JACK 0 diff --git a/modules/juce_audio_devices/native/juce_JackAudio_linux.cpp b/modules/juce_audio_devices/native/juce_JackAudio.cpp similarity index 95% rename from modules/juce_audio_devices/native/juce_JackAudio_linux.cpp rename to modules/juce_audio_devices/native/juce_JackAudio.cpp index 739fc2ebd44..5cb8e1a633d 100644 --- a/modules/juce_audio_devices/native/juce_JackAudio_linux.cpp +++ b/modules/juce_audio_devices/native/juce_JackAudio.cpp @@ -30,7 +30,12 @@ static void* juce_loadJackFunction (const char* const name) if (juce_libjackHandle == nullptr) return nullptr; +#if JUCE_WINDOWS + return GetProcAddress ((HMODULE) juce_libjackHandle, name); +#else return dlsym (juce_libjackHandle, name); +#endif + } #define JUCE_DECL_JACK_FUNCTION(return_type, fn_name, argument_types, arguments) \ @@ -592,8 +597,18 @@ class JackAudioIODeviceType final : public AudioIODeviceType inputNames.clear(); outputNames.clear(); +#if (JUCE_LINUX || JUCE_BSD) if (juce_libjackHandle == nullptr) juce_libjackHandle = dlopen ("libjack.so.0", RTLD_LAZY); if (juce_libjackHandle == nullptr) juce_libjackHandle = dlopen ("libjack.so", RTLD_LAZY); +#elif JUCE_MAC + if (juce_libjackHandle == nullptr) juce_libjackHandle = dlopen ("libjack.dylib", RTLD_LAZY); +#elif JUCE_WINDOWS + #if JUCE_64BIT + if (juce_libjackHandle == nullptr) juce_libjackHandle = LoadLibraryA ("libjack64.dll"); + #else + if (juce_libjackHandle == nullptr) juce_libjackHandle = LoadLibraryA ("libjack.dll"); + #endif +#endif if (juce_libjackHandle == nullptr) return; jack_status_t status = {};