Skip to content

Commit f43ad6a

Browse files
committed
jack4all
1 parent 7ba1107 commit f43ad6a

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

modules/juce_audio_devices/audio_io/juce_AudioIODeviceType.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void AudioIODeviceType::callDeviceChangeListeners()
100100
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_ALSA() { return nullptr; }
101101
#endif
102102

103-
#if (JUCE_LINUX || JUCE_BSD) && JUCE_JACK
103+
#if (JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_WINDOWS) && JUCE_JACK
104104
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return new JackAudioIODeviceType(); }
105105
#else
106106
AudioIODeviceType* AudioIODeviceType::createAudioIODeviceType_JACK() { return nullptr; }

modules/juce_audio_devices/juce_audio_devices.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,6 @@
176176
#include "native/juce_ALSA_linux.cpp"
177177
#endif
178178

179-
#if JUCE_JACK
180-
/* Got an include error here? If so, you've either not got jack-audio-connection-kit
181-
installed, or you've not got your paths set up correctly to find its header files.
182-
183-
The package you need to install to get JACK support is "libjack-dev".
184-
185-
If you don't have the jack-audio-connection-kit library and don't want to build
186-
JUCE with low latency audio support, just set the JUCE_JACK flag to 0.
187-
*/
188-
#include <jack/jack.h>
189-
#include "native/juce_JackAudio_linux.cpp"
190-
#endif
191-
192179
#if (JUCE_LINUX && JUCE_BELA)
193180
/* Got an include error here? If so, you've either not got the bela headers
194181
installed, or you've not got your paths set up correctly to find its header
@@ -258,6 +245,20 @@ namespace juce
258245

259246
#endif
260247

248+
//==============================================================================
249+
#if (JUCE_LINUX || JUCE_BSD || JUCE_MAC || JUCE_WINDOWS) && JUCE_JACK
250+
/* Got an include error here? If so, you've either not got jack-audio-connection-kit
251+
installed, or you've not got your paths set up correctly to find its header files.
252+
253+
The package you need to install to get JACK support is "libjack-dev".
254+
255+
If you don't have the jack-audio-connection-kit library and don't want to build
256+
JUCE with low latency audio support, just set the JUCE_JACK flag to 0.
257+
*/
258+
#include <jack/jack.h>
259+
#include "native/juce_JackAudio.cpp"
260+
#endif
261+
261262
#include "midi_io/juce_MidiDevices.cpp"
262263

263264
#if ! JUCE_SYSTEMAUDIOVOL_IMPLEMENTED

modules/juce_audio_devices/juce_audio_devices.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
#endif
122122

123123
/** Config: JUCE_JACK
124-
Enables JACK audio devices (Linux only).
124+
Enables JACK audio devices.
125125
*/
126126
#ifndef JUCE_JACK
127127
#define JUCE_JACK 0

modules/juce_audio_devices/native/juce_JackAudio_linux.cpp renamed to modules/juce_audio_devices/native/juce_JackAudio.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ static void* juce_loadJackFunction (const char* const name)
4242
if (juce_libjackHandle == nullptr)
4343
return nullptr;
4444

45+
#if JUCE_WINDOWS
46+
return GetProcAddress ((HMODULE) juce_libjackHandle, name);
47+
#else
4548
return dlsym (juce_libjackHandle, name);
49+
#endif
4650
}
4751

4852
#define JUCE_DECL_JACK_FUNCTION(return_type, fn_name, argument_types, arguments) \
@@ -604,8 +608,18 @@ class JackAudioIODeviceType final : public AudioIODeviceType
604608
inputNames.clear();
605609
outputNames.clear();
606610

611+
#if (JUCE_LINUX || JUCE_BSD)
607612
if (juce_libjackHandle == nullptr) juce_libjackHandle = dlopen ("libjack.so.0", RTLD_LAZY);
608613
if (juce_libjackHandle == nullptr) juce_libjackHandle = dlopen ("libjack.so", RTLD_LAZY);
614+
#elif JUCE_MAC
615+
if (juce_libjackHandle == nullptr) juce_libjackHandle = dlopen ("libjack.dylib", RTLD_LAZY);
616+
#elif JUCE_WINDOWS
617+
#if JUCE_64BIT
618+
if (juce_libjackHandle == nullptr) juce_libjackHandle = LoadLibraryA ("libjack64.dll");
619+
#else
620+
if (juce_libjackHandle == nullptr) juce_libjackHandle = LoadLibraryA ("libjack.dll");
621+
#endif
622+
#endif
609623
if (juce_libjackHandle == nullptr) return;
610624

611625
jack_status_t status = {};

0 commit comments

Comments
 (0)