| @@ -19,7 +19,7 @@ | |||
| #if defined(DISTRHO_PLUGIN_TARGET_CARLA) | |||
| # include "src/DistrhoPluginCarla.cpp" | |||
| #elif defined(DISTRHO_PLUGIN_TARGET_JACK) | |||
| # include "src/DistrhoPluginJack.cpp" | |||
| # include "src/DistrhoPluginJACK.cpp" | |||
| #elif (defined(DISTRHO_PLUGIN_TARGET_LADSPA) || defined(DISTRHO_PLUGIN_TARGET_DSSI)) | |||
| # include "src/DistrhoPluginLADSPA+DSSI.cpp" | |||
| #elif defined(DISTRHO_PLUGIN_TARGET_LV2) | |||
| @@ -0,0 +1,120 @@ | |||
| /* | |||
| * DISTRHO Plugin Framework (DPF) | |||
| * Copyright (C) 2012-2021 Filipe Coelho <falktx@falktx.com> | |||
| * | |||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | |||
| * or without fee is hereby granted, provided that the above copyright notice and this | |||
| * permission notice appear in all copies. | |||
| * | |||
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD | |||
| * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | |||
| * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL | |||
| * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |||
| * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | |||
| * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |||
| */ | |||
| #ifndef DISTRHO_LIBRARY_UTILS_HPP_INCLUDED | |||
| #define DISTRHO_LIBRARY_UTILS_HPP_INCLUDED | |||
| #include "../DistrhoUtils.hpp" | |||
| #ifdef DISTRHO_OS_WINDOWS | |||
| typedef HMODULE lib_t; | |||
| #else | |||
| # include <dlfcn.h> | |||
| typedef void* lib_t; | |||
| #endif | |||
| // ----------------------------------------------------------------------- | |||
| // library related calls | |||
| /* | |||
| * Open 'filename' library (must not be null). | |||
| * May return null, in which case "lib_error" has the error. | |||
| */ | |||
| static inline | |||
| lib_t lib_open(const char* const filename) noexcept | |||
| { | |||
| DISTRHO_SAFE_ASSERT_RETURN(filename != nullptr && filename[0] != '\0', nullptr); | |||
| try { | |||
| #ifdef DISTRHO_OS_WINDOWS | |||
| return ::LoadLibraryA(filename); | |||
| #else | |||
| return ::dlopen(filename, RTLD_NOW|RTLD_LOCAL); | |||
| #endif | |||
| } DISTRHO_SAFE_EXCEPTION_RETURN("lib_open", nullptr); | |||
| } | |||
| /* | |||
| * Close a previously opened library (must not be null). | |||
| * If false is returned, "lib_error" has the error. | |||
| */ | |||
| static inline | |||
| bool lib_close(const lib_t lib) noexcept | |||
| { | |||
| DISTRHO_SAFE_ASSERT_RETURN(lib != nullptr, false); | |||
| try { | |||
| #ifdef DISTRHO_OS_WINDOWS | |||
| return ::FreeLibrary(lib); | |||
| #else | |||
| return (::dlclose(lib) == 0); | |||
| #endif | |||
| } DISTRHO_SAFE_EXCEPTION_RETURN("lib_close", false); | |||
| } | |||
| /* | |||
| * Get a library symbol (must not be null). | |||
| * Returns null if the symbol is not found. | |||
| */ | |||
| template<typename Func> | |||
| static inline | |||
| Func lib_symbol(const lib_t lib, const char* const symbol) noexcept | |||
| { | |||
| DISTRHO_SAFE_ASSERT_RETURN(lib != nullptr, nullptr); | |||
| DISTRHO_SAFE_ASSERT_RETURN(symbol != nullptr && symbol[0] != '\0', nullptr); | |||
| try { | |||
| #ifdef DISTRHO_OS_WINDOWS | |||
| return (Func)::GetProcAddress(lib, symbol); | |||
| #else | |||
| return (Func)(uintptr_t)::dlsym(lib, symbol); | |||
| #endif | |||
| } DISTRHO_SAFE_EXCEPTION_RETURN("lib_symbol", nullptr); | |||
| } | |||
| /* | |||
| * Return the last operation error ('filename' must not be null). | |||
| * May return null. | |||
| */ | |||
| static inline | |||
| const char* lib_error(const char* const filename) noexcept | |||
| { | |||
| DISTRHO_SAFE_ASSERT_RETURN(filename != nullptr && filename[0] != '\0', nullptr); | |||
| #ifdef DISTRHO_OS_WINDOWS | |||
| static char libError[2048+1]; | |||
| std::memset(libError, 0, sizeof(libError)); | |||
| try { | |||
| const DWORD winErrorCode = ::GetLastError(); | |||
| const int winErrorFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS; | |||
| LPVOID winErrorString; | |||
| ::FormatMessage(winErrorFlags, nullptr, winErrorCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR)&winErrorString, 0, nullptr); | |||
| std::snprintf(libError, 2048, "%s: error code %li: %s", filename, winErrorCode, (const char*)winErrorString); | |||
| ::LocalFree(winErrorString); | |||
| } DISTRHO_SAFE_EXCEPTION("lib_error"); | |||
| return (libError[0] != '\0') ? libError : nullptr; | |||
| #else | |||
| return ::dlerror(); | |||
| #endif | |||
| } | |||
| // ----------------------------------------------------------------------- | |||
| #endif // DISTRHO_LIBRARY_UTILS_HPP_INCLUDED | |||
| @@ -23,11 +23,7 @@ | |||
| # include "../extra/Sleep.hpp" | |||
| #endif | |||
| #include "jack/jack.h" | |||
| #include "jack/metadata.h" | |||
| #include "jack/midiport.h" | |||
| #include "jack/transport.h" | |||
| #include "jack/uuid.h" | |||
| #include "jackbridge/JackBridge1.cpp" | |||
| #include "lv2/lv2.h" | |||
| #ifndef DISTRHO_OS_WINDOWS | |||
| @@ -38,6 +34,10 @@ | |||
| # define JACK_METADATA_ORDER "http://jackaudio.org/metadata/order" | |||
| #endif | |||
| #ifndef JACK_METADATA_PRETTY_NAME | |||
| # define JACK_METADATA_PRETTY_NAME "http://jackaudio.org/metadata/pretty-name" | |||
| #endif | |||
| #ifndef JACK_METADATA_SIGNAL_TYPE | |||
| # define JACK_METADATA_SIGNAL_TYPE "http://jackaudio.org/metadata/signal-type" | |||
| #endif | |||
| @@ -132,7 +132,7 @@ public: | |||
| for (uint32_t i=0; i < DISTRHO_PLUGIN_NUM_INPUTS; ++i) | |||
| { | |||
| const AudioPort& port(fPlugin.getAudioPort(true, i)); | |||
| fPortAudioIns[i] = jack_port_register(fClient, port.symbol, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); | |||
| fPortAudioIns[i] = jackbridge_port_register(fClient, port.symbol, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); | |||
| setAudioPortMetadata(port, fPortAudioIns[i], i); | |||
| } | |||
| # endif | |||
| @@ -141,16 +141,16 @@ public: | |||
| { | |||
| std::snprintf(strBuf, 0xff, "out%i", i+1); | |||
| const AudioPort& port(fPlugin.getAudioPort(false, i)); | |||
| fPortAudioOuts[i] = jack_port_register(fClient, port.symbol, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); | |||
| fPortAudioOuts[i] = jackbridge_port_register(fClient, port.symbol, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); | |||
| setAudioPortMetadata(port, fPortAudioOuts[i], DISTRHO_PLUGIN_NUM_INPUTS+i); | |||
| } | |||
| # endif | |||
| #endif | |||
| fPortEventsIn = jack_port_register(fClient, "events-in", JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0); | |||
| fPortEventsIn = jackbridge_port_register(fClient, "events-in", JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0); | |||
| #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT | |||
| fPortMidiOut = jack_port_register(fClient, "midi-out", JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0); | |||
| fPortMidiOut = jackbridge_port_register(fClient, "midi-out", JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0); | |||
| fPortMidiOutBuffer = nullptr; | |||
| #endif | |||
| @@ -193,17 +193,17 @@ public: | |||
| #endif | |||
| } | |||
| jack_set_buffer_size_callback(fClient, jackBufferSizeCallback, this); | |||
| jack_set_sample_rate_callback(fClient, jackSampleRateCallback, this); | |||
| jack_set_process_callback(fClient, jackProcessCallback, this); | |||
| jack_on_shutdown(fClient, jackShutdownCallback, this); | |||
| jackbridge_set_buffer_size_callback(fClient, jackBufferSizeCallback, this); | |||
| jackbridge_set_sample_rate_callback(fClient, jackSampleRateCallback, this); | |||
| jackbridge_set_process_callback(fClient, jackProcessCallback, this); | |||
| jackbridge_on_shutdown(fClient, jackShutdownCallback, this); | |||
| fPlugin.activate(); | |||
| jack_activate(fClient); | |||
| jackbridge_activate(fClient); | |||
| #if DISTRHO_PLUGIN_HAS_UI | |||
| if (const char* const name = jack_get_client_name(fClient)) | |||
| if (const char* const name = jackbridge_get_client_name(fClient)) | |||
| fUI.setWindowTitle(name); | |||
| else | |||
| fUI.setWindowTitle(fPlugin.getName()); | |||
| @@ -218,7 +218,7 @@ public: | |||
| ~PluginJack() | |||
| { | |||
| if (fClient != nullptr) | |||
| jack_deactivate(fClient); | |||
| jackbridge_deactivate(fClient); | |||
| if (fLastOutputValues != nullptr) | |||
| { | |||
| @@ -240,17 +240,17 @@ public: | |||
| return; | |||
| #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT | |||
| jack_port_unregister(fClient, fPortMidiOut); | |||
| jackbridge_port_unregister(fClient, fPortMidiOut); | |||
| fPortMidiOut = nullptr; | |||
| #endif | |||
| jack_port_unregister(fClient, fPortEventsIn); | |||
| jackbridge_port_unregister(fClient, fPortEventsIn); | |||
| fPortEventsIn = nullptr; | |||
| #if DISTRHO_PLUGIN_NUM_INPUTS > 0 | |||
| for (uint32_t i=0; i < DISTRHO_PLUGIN_NUM_INPUTS; ++i) | |||
| { | |||
| jack_port_unregister(fClient, fPortAudioIns[i]); | |||
| jackbridge_port_unregister(fClient, fPortAudioIns[i]); | |||
| fPortAudioIns[i] = nullptr; | |||
| } | |||
| #endif | |||
| @@ -258,12 +258,12 @@ public: | |||
| #if DISTRHO_PLUGIN_NUM_OUTPUTS > 0 | |||
| for (uint32_t i=0; i < DISTRHO_PLUGIN_NUM_OUTPUTS; ++i) | |||
| { | |||
| jack_port_unregister(fClient, fPortAudioOuts[i]); | |||
| jackbridge_port_unregister(fClient, fPortAudioOuts[i]); | |||
| fPortAudioOuts[i] = nullptr; | |||
| } | |||
| #endif | |||
| jack_client_close(fClient); | |||
| jackbridge_client_close(fClient); | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -322,7 +322,7 @@ protected: | |||
| const float* audioIns[DISTRHO_PLUGIN_NUM_INPUTS]; | |||
| for (uint32_t i=0; i < DISTRHO_PLUGIN_NUM_INPUTS; ++i) | |||
| audioIns[i] = (const float*)jack_port_get_buffer(fPortAudioIns[i], nframes); | |||
| audioIns[i] = (const float*)jackbridge_port_get_buffer(fPortAudioIns[i], nframes); | |||
| #else | |||
| static const float** audioIns = nullptr; | |||
| #endif | |||
| @@ -331,20 +331,20 @@ protected: | |||
| float* audioOuts[DISTRHO_PLUGIN_NUM_OUTPUTS]; | |||
| for (uint32_t i=0; i < DISTRHO_PLUGIN_NUM_OUTPUTS; ++i) | |||
| audioOuts[i] = (float*)jack_port_get_buffer(fPortAudioOuts[i], nframes); | |||
| audioOuts[i] = (float*)jackbridge_port_get_buffer(fPortAudioOuts[i], nframes); | |||
| #else | |||
| static float** audioOuts = nullptr; | |||
| #endif | |||
| #if DISTRHO_PLUGIN_WANT_TIMEPOS | |||
| jack_position_t pos; | |||
| fTimePosition.playing = (jack_transport_query(fClient, &pos) == JackTransportRolling); | |||
| fTimePosition.playing = (jackbridge_transport_query(fClient, &pos) == JackTransportRolling); | |||
| if (pos.unique_1 == pos.unique_2) | |||
| { | |||
| fTimePosition.frame = pos.frame; | |||
| if (pos.valid & JackTransportBBT) | |||
| if (pos.valid & JackPositionBBT) | |||
| { | |||
| fTimePosition.bbt.valid = true; | |||
| @@ -374,8 +374,8 @@ protected: | |||
| updateParameterTriggers(); | |||
| #if DISTRHO_PLUGIN_WANT_MIDI_OUTPUT | |||
| fPortMidiOutBuffer = jack_port_get_buffer(fPortMidiOut, nframes); | |||
| jack_midi_clear_buffer(fPortMidiOutBuffer); | |||
| fPortMidiOutBuffer = jackbridge_port_get_buffer(fPortMidiOut, nframes); | |||
| jackbridge_midi_clear_buffer(fPortMidiOutBuffer); | |||
| #endif | |||
| #if DISTRHO_PLUGIN_WANT_MIDI_INPUT | |||
| @@ -402,15 +402,15 @@ protected: | |||
| static const uint32_t midiEventCount = 0; | |||
| #endif | |||
| void* const midiInBuf = jack_port_get_buffer(fPortEventsIn, nframes); | |||
| void* const midiInBuf = jackbridge_port_get_buffer(fPortEventsIn, nframes); | |||
| if (const uint32_t eventCount = std::max(512u - midiEventCount, jack_midi_get_event_count(midiInBuf))) | |||
| if (const uint32_t eventCount = std::max(512u - midiEventCount, jackbridge_midi_get_event_count(midiInBuf))) | |||
| { | |||
| jack_midi_event_t jevent; | |||
| for (uint32_t i=0; i < eventCount; ++i) | |||
| { | |||
| if (jack_midi_event_get(&jevent, midiInBuf, i) != 0) | |||
| if (jackbridge_midi_event_get(&jevent, midiInBuf, i) != 0) | |||
| break; | |||
| // Check if message is control change on channel 1 | |||
| @@ -575,26 +575,26 @@ private: | |||
| { | |||
| DISTRHO_SAFE_ASSERT_RETURN(jackport != nullptr,); | |||
| const jack_uuid_t uuid = jack_port_uuid(jackport); | |||
| const jack_uuid_t uuid = jackbridge_port_uuid(jackport); | |||
| if (jack_uuid_empty(uuid)) | |||
| if (uuid == JACK_UUID_EMPTY_INITIALIZER) | |||
| return; | |||
| jack_set_property(fClient, uuid, JACK_METADATA_PRETTY_NAME, port.name, "text/plain"); | |||
| jackbridge_set_property(fClient, uuid, JACK_METADATA_PRETTY_NAME, port.name, "text/plain"); | |||
| { | |||
| char strBuf[0xff]; | |||
| snprintf(strBuf, sizeof(0xff)-1, "%u", index); | |||
| jack_set_property(fClient, uuid, JACK_METADATA_ORDER, strBuf, "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, JACK_METADATA_ORDER, strBuf, "http://www.w3.org/2001/XMLSchema#integer"); | |||
| } | |||
| if (port.hints & kAudioPortIsCV) | |||
| { | |||
| jack_set_property(fClient, uuid, JACK_METADATA_SIGNAL_TYPE, "CV", "text/plain"); | |||
| jackbridge_set_property(fClient, uuid, JACK_METADATA_SIGNAL_TYPE, "CV", "text/plain"); | |||
| } | |||
| else | |||
| { | |||
| jack_set_property(fClient, uuid, JACK_METADATA_SIGNAL_TYPE, "AUDIO", "text/plain"); | |||
| jackbridge_set_property(fClient, uuid, JACK_METADATA_SIGNAL_TYPE, "AUDIO", "text/plain"); | |||
| return; | |||
| } | |||
| @@ -605,39 +605,39 @@ private: | |||
| { | |||
| if (cvPortScaled) | |||
| { | |||
| jack_set_property(fClient, uuid, LV2_CORE__minimum, "-5", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jack_set_property(fClient, uuid, LV2_CORE__maximum, "5", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__minimum, "-5", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__maximum, "5", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| } | |||
| else | |||
| { | |||
| jack_set_property(fClient, uuid, LV2_CORE__minimum, "-1", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jack_set_property(fClient, uuid, LV2_CORE__maximum, "1", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__minimum, "-1", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__maximum, "1", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| } | |||
| } | |||
| else if (port.hints & kCVPortHasNegativeUnipolarRange) | |||
| { | |||
| if (cvPortScaled) | |||
| { | |||
| jack_set_property(fClient, uuid, LV2_CORE__minimum, "-10", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jack_set_property(fClient, uuid, LV2_CORE__maximum, "0", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__minimum, "-10", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__maximum, "0", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| } | |||
| else | |||
| { | |||
| jack_set_property(fClient, uuid, LV2_CORE__minimum, "-1", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jack_set_property(fClient, uuid, LV2_CORE__maximum, "0", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__minimum, "-1", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__maximum, "0", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| } | |||
| } | |||
| else if (port.hints & kCVPortHasPositiveUnipolarRange) | |||
| { | |||
| if (cvPortScaled) | |||
| { | |||
| jack_set_property(fClient, uuid, LV2_CORE__minimum, "0", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jack_set_property(fClient, uuid, LV2_CORE__maximum, "10", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__minimum, "0", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__maximum, "10", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| } | |||
| else | |||
| { | |||
| jack_set_property(fClient, uuid, LV2_CORE__minimum, "0", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jack_set_property(fClient, uuid, LV2_CORE__maximum, "1", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__minimum, "0", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| jackbridge_set_property(fClient, uuid, LV2_CORE__maximum, "1", "http://www.w3.org/2001/XMLSchema#integer"); | |||
| } | |||
| } | |||
| } | |||
| @@ -738,7 +738,7 @@ int main() | |||
| USE_NAMESPACE_DISTRHO; | |||
| jack_status_t status = jack_status_t(0x0); | |||
| jack_client_t* client = jack_client_open(DISTRHO_PLUGIN_NAME, JackNoStartServer, &status); | |||
| jack_client_t* client = jackbridge_client_open(DISTRHO_PLUGIN_NAME, JackNoStartServer, &status); | |||
| if (client == nullptr) | |||
| { | |||
| @@ -786,8 +786,8 @@ int main() | |||
| initSignalHandler(); | |||
| d_lastBufferSize = jack_get_buffer_size(client); | |||
| d_lastSampleRate = jack_get_sample_rate(client); | |||
| d_lastBufferSize = jackbridge_get_buffer_size(client); | |||
| d_lastSampleRate = jackbridge_get_sample_rate(client); | |||
| d_lastCanRequestParameterValueChanges = true; | |||
| const PluginJack p(client); | |||
| @@ -0,0 +1,422 @@ | |||
| /* | |||
| * JackBridge for DPF | |||
| * Copyright (C) 2013-2021 Filipe Coelho <falktx@falktx.com> | |||
| * | |||
| * Permission to use, copy, modify, and/or distribute this software for any purpose with | |||
| * or without fee is hereby granted, provided that the above copyright notice and this | |||
| * permission notice appear in all copies. | |||
| * | |||
| * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD | |||
| * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN | |||
| * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL | |||
| * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER | |||
| * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN | |||
| * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |||
| */ | |||
| #ifndef JACKBRIDGE_HPP_INCLUDED | |||
| #define JACKBRIDGE_HPP_INCLUDED | |||
| #ifdef __WINE__ | |||
| # if defined(WIN64) || defined(_WIN64) || defined(__WIN64__) | |||
| # define __WINE64__ | |||
| # endif | |||
| # undef WIN32 | |||
| # undef WIN64 | |||
| # undef _WIN32 | |||
| # undef _WIN64 | |||
| # undef __WIN32__ | |||
| # undef __WIN64__ | |||
| #endif | |||
| #include "../DistrhoDefines.h" | |||
| #if (defined(__WINE__) || defined(DISTRHO_OS_WINDOWS)) && defined(__cdecl) | |||
| # define JACKBRIDGE_API __cdecl | |||
| #else | |||
| # define JACKBRIDGE_API | |||
| #endif | |||
| #ifdef JACKBRIDGE_DIRECT | |||
| # include <jack/jack.h> | |||
| # include <jack/midiport.h> | |||
| # include <jack/transport.h> | |||
| # include <jack/session.h> | |||
| # include <jack/metadata.h> | |||
| # include <jack/uuid.h> | |||
| #else | |||
| #include <cstddef> | |||
| #ifdef DISTRHO_PROPER_CPP11_SUPPORT | |||
| # include <cstdint> | |||
| #else | |||
| # include <stdint.h> | |||
| #endif | |||
| #ifndef POST_PACKED_STRUCTURE | |||
| # if defined(__GNUC__) | |||
| /* POST_PACKED_STRUCTURE needs to be a macro which | |||
| expands into a compiler directive. The directive must | |||
| tell the compiler to arrange the preceding structure | |||
| declaration so that it is packed on byte-boundaries rather | |||
| than use the natural alignment of the processor and/or | |||
| compiler. | |||
| */ | |||
| #define PRE_PACKED_STRUCTURE | |||
| #define POST_PACKED_STRUCTURE __attribute__((__packed__)) | |||
| # elif defined(_MSC_VER) | |||
| #define PRE_PACKED_STRUCTURE1 __pragma(pack(push,1)) | |||
| #define PRE_PACKED_STRUCTURE PRE_PACKED_STRUCTURE1 | |||
| /* PRE_PACKED_STRUCTURE needs to be a macro which | |||
| expands into a compiler directive. The directive must | |||
| tell the compiler to arrange the following structure | |||
| declaration so that it is packed on byte-boundaries rather | |||
| than use the natural alignment of the processor and/or | |||
| compiler. | |||
| */ | |||
| #define POST_PACKED_STRUCTURE ;__pragma(pack(pop)) | |||
| /* and POST_PACKED_STRUCTURE needs to be a macro which | |||
| restores the packing to its previous setting */ | |||
| # else | |||
| #define PRE_PACKED_STRUCTURE | |||
| #define POST_PACKED_STRUCTURE | |||
| # endif | |||
| #endif | |||
| #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio" | |||
| #define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi" | |||
| #define JACK_MAX_FRAMES (4294967295U) | |||
| #define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName) | |||
| #define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName) | |||
| #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode|JackBBTFrameOffset|JackAudioVideoRatio|JackVideoFrameOffset) | |||
| #define EXTENDED_TIME_INFO | |||
| #define JACK_UUID_SIZE 36 | |||
| #define JACK_UUID_STRING_SIZE (JACK_UUID_SIZE+1) /* includes trailing null */ | |||
| #define JACK_UUID_EMPTY_INITIALIZER 0 | |||
| extern "C" { | |||
| enum JackOptions { | |||
| JackNullOption = 0x00, | |||
| JackNoStartServer = 0x01, | |||
| JackUseExactName = 0x02, | |||
| JackServerName = 0x04, | |||
| JackLoadName = 0x08, | |||
| JackLoadInit = 0x10, | |||
| JackSessionID = 0x20 | |||
| }; | |||
| enum JackStatus { | |||
| JackFailure = 0x0001, | |||
| JackInvalidOption = 0x0002, | |||
| JackNameNotUnique = 0x0004, | |||
| JackServerStarted = 0x0008, | |||
| JackServerFailed = 0x0010, | |||
| JackServerError = 0x0020, | |||
| JackNoSuchClient = 0x0040, | |||
| JackLoadFailure = 0x0080, | |||
| JackInitFailure = 0x0100, | |||
| JackShmFailure = 0x0200, | |||
| JackVersionError = 0x0400, | |||
| JackBackendError = 0x0800, | |||
| JackClientZombie = 0x1000 | |||
| }; | |||
| enum JackLatencyCallbackMode { | |||
| JackCaptureLatency, | |||
| JackPlaybackLatency | |||
| }; | |||
| enum JackPortFlags { | |||
| JackPortIsInput = 0x01, | |||
| JackPortIsOutput = 0x02, | |||
| JackPortIsPhysical = 0x04, | |||
| JackPortCanMonitor = 0x08, | |||
| JackPortIsTerminal = 0x10, | |||
| JackPortIsControlVoltage = 0x100 | |||
| }; | |||
| enum JackTransportState { | |||
| JackTransportStopped = 0, | |||
| JackTransportRolling = 1, | |||
| JackTransportLooping = 2, | |||
| JackTransportStarting = 3 | |||
| }; | |||
| enum JackPositionBits { | |||
| JackPositionBBT = 0x010, | |||
| JackPositionTimecode = 0x020, | |||
| JackBBTFrameOffset = 0x040, | |||
| JackAudioVideoRatio = 0x080, | |||
| JackVideoFrameOffset = 0x100 | |||
| }; | |||
| enum JackSessionEventType { | |||
| JackSessionSave = 1, | |||
| JackSessionSaveAndQuit = 2, | |||
| JackSessionSaveTemplate = 3 | |||
| }; | |||
| enum JackSessionFlags { | |||
| JackSessionSaveError = 0x1, | |||
| JackSessionNeedTerminal = 0x2 | |||
| }; | |||
| enum JackPropertyChange { | |||
| PropertyCreated, | |||
| PropertyChanged, | |||
| PropertyDeleted | |||
| }; | |||
| typedef uint32_t jack_nframes_t; | |||
| typedef uint32_t jack_port_id_t; | |||
| typedef uint64_t jack_time_t; | |||
| typedef uint64_t jack_uuid_t; | |||
| typedef uint64_t jack_unique_t; | |||
| typedef uchar jack_midi_data_t; | |||
| typedef float jack_default_audio_sample_t; | |||
| typedef enum JackOptions jack_options_t; | |||
| typedef enum JackStatus jack_status_t; | |||
| typedef enum JackLatencyCallbackMode jack_latency_callback_mode_t; | |||
| typedef enum JackTransportState jack_transport_state_t; | |||
| typedef enum JackPositionBits jack_position_bits_t; | |||
| typedef enum JackSessionEventType jack_session_event_type_t; | |||
| typedef enum JackSessionFlags jack_session_flags_t; | |||
| typedef enum JackPropertyChange jack_property_change_t; | |||
| struct _jack_midi_event { | |||
| jack_nframes_t time; | |||
| size_t size; | |||
| jack_midi_data_t* buffer; | |||
| }; | |||
| // NOTE: packed in JACK2 but not in JACK1 | |||
| PRE_PACKED_STRUCTURE | |||
| struct _jack_latency_range { | |||
| jack_nframes_t min; | |||
| jack_nframes_t max; | |||
| } POST_PACKED_STRUCTURE; | |||
| PRE_PACKED_STRUCTURE | |||
| struct _jack_position { | |||
| jack_unique_t unique_1; | |||
| jack_time_t usecs; | |||
| jack_nframes_t frame_rate; | |||
| jack_nframes_t frame; | |||
| jack_position_bits_t valid; | |||
| int32_t bar; | |||
| int32_t beat; | |||
| int32_t tick; | |||
| double bar_start_tick; | |||
| float beats_per_bar; | |||
| float beat_type; | |||
| double ticks_per_beat; | |||
| double beats_per_minute; | |||
| double frame_time; | |||
| double next_time; | |||
| jack_nframes_t bbt_offset; | |||
| float audio_frames_per_video_frame; | |||
| jack_nframes_t video_offset; | |||
| int32_t padding[7]; | |||
| jack_unique_t unique_2; | |||
| } POST_PACKED_STRUCTURE; | |||
| struct _jack_session_event { | |||
| jack_session_event_type_t type; | |||
| const char* session_dir; | |||
| const char* client_uuid; | |||
| char* command_line; | |||
| jack_session_flags_t flags; | |||
| uint32_t future; | |||
| }; | |||
| struct _jack_session_command_t { | |||
| const char* uuid; | |||
| const char* client_name; | |||
| const char* command; | |||
| jack_session_flags_t flags; | |||
| }; | |||
| typedef struct { | |||
| const char* key; | |||
| const char* data; | |||
| const char* type; | |||
| } jack_property_t; | |||
| typedef struct { | |||
| jack_uuid_t subject; | |||
| uint32_t property_cnt; | |||
| jack_property_t* properties; | |||
| uint32_t property_size; | |||
| } jack_description_t; | |||
| typedef struct _jack_port jack_port_t; | |||
| typedef struct _jack_client jack_client_t; | |||
| typedef struct _jack_midi_event jack_midi_event_t; | |||
| typedef struct _jack_latency_range jack_latency_range_t; | |||
| typedef struct _jack_position jack_position_t; | |||
| typedef struct _jack_session_event jack_session_event_t; | |||
| typedef struct _jack_session_command_t jack_session_command_t; | |||
| typedef void (JACKBRIDGE_API *JackLatencyCallback)(jack_latency_callback_mode_t mode, void* arg); | |||
| typedef int (JACKBRIDGE_API *JackProcessCallback)(jack_nframes_t nframes, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackThreadInitCallback)(void* arg); | |||
| typedef int (JACKBRIDGE_API *JackGraphOrderCallback)(void* arg); | |||
| typedef int (JACKBRIDGE_API *JackXRunCallback)(void* arg); | |||
| typedef int (JACKBRIDGE_API *JackBufferSizeCallback)(jack_nframes_t nframes, void* arg); | |||
| typedef int (JACKBRIDGE_API *JackSampleRateCallback)(jack_nframes_t nframes, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackPortRegistrationCallback)(jack_port_id_t port, int register_, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackClientRegistrationCallback)(const char* name, int register_, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackFreewheelCallback)(int starting, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackShutdownCallback)(void* arg); | |||
| typedef void (JACKBRIDGE_API *JackInfoShutdownCallback)(jack_status_t code, const char* reason, void* arg); | |||
| typedef int (JACKBRIDGE_API *JackSyncCallback)(jack_transport_state_t state, jack_position_t* pos, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackTimebaseCallback)(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t* pos, int new_pos, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackSessionCallback)(jack_session_event_t* event, void* arg); | |||
| typedef void (JACKBRIDGE_API *JackPropertyChangeCallback)(jack_uuid_t subject, const char* key, jack_property_change_t change, void* arg); | |||
| } // extern "C" | |||
| #endif // ! JACKBRIDGE_DIRECT | |||
| JACKBRIDGE_API bool jackbridge_is_ok() noexcept; | |||
| JACKBRIDGE_API void jackbridge_init(); | |||
| JACKBRIDGE_API void jackbridge_get_version(int* major_ptr, int* minor_ptr, int* micro_ptr, int* proto_ptr); | |||
| JACKBRIDGE_API const char* jackbridge_get_version_string(); | |||
| JACKBRIDGE_API jack_client_t* jackbridge_client_open(const char* client_name, uint32_t options, jack_status_t* status); | |||
| JACKBRIDGE_API bool jackbridge_client_close(jack_client_t* client); | |||
| JACKBRIDGE_API int jackbridge_client_name_size(); | |||
| JACKBRIDGE_API char* jackbridge_get_client_name(jack_client_t* client); | |||
| JACKBRIDGE_API char* jackbridge_client_get_uuid(jack_client_t* client); | |||
| JACKBRIDGE_API char* jackbridge_get_uuid_for_client_name(jack_client_t* client, const char* name); | |||
| JACKBRIDGE_API char* jackbridge_get_client_name_by_uuid(jack_client_t* client, const char* uuid); | |||
| JACKBRIDGE_API bool jackbridge_uuid_parse(const char* buf, jack_uuid_t* uuid); | |||
| JACKBRIDGE_API void jackbridge_uuid_unparse(jack_uuid_t uuid, char buf[JACK_UUID_STRING_SIZE]); | |||
| JACKBRIDGE_API bool jackbridge_activate(jack_client_t* client); | |||
| JACKBRIDGE_API bool jackbridge_deactivate(jack_client_t* client); | |||
| JACKBRIDGE_API bool jackbridge_is_realtime(jack_client_t* client); | |||
| JACKBRIDGE_API bool jackbridge_set_thread_init_callback(jack_client_t* client, JackThreadInitCallback thread_init_callback, void* arg); | |||
| JACKBRIDGE_API void jackbridge_on_shutdown(jack_client_t* client, JackShutdownCallback shutdown_callback, void* arg); | |||
| JACKBRIDGE_API void jackbridge_on_info_shutdown(jack_client_t* client, JackInfoShutdownCallback shutdown_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_process_callback(jack_client_t* client, JackProcessCallback process_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_freewheel_callback(jack_client_t* client, JackFreewheelCallback freewheel_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_buffer_size_callback(jack_client_t* client, JackBufferSizeCallback bufsize_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_sample_rate_callback(jack_client_t* client, JackSampleRateCallback srate_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_client_registration_callback(jack_client_t* client, JackClientRegistrationCallback registration_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_port_registration_callback(jack_client_t* client, JackPortRegistrationCallback registration_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_port_rename_callback(jack_client_t* client, JackPortRenameCallback rename_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_port_connect_callback(jack_client_t* client, JackPortConnectCallback connect_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_graph_order_callback(jack_client_t* client, JackGraphOrderCallback graph_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_xrun_callback(jack_client_t* client, JackXRunCallback xrun_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_latency_callback(jack_client_t* client, JackLatencyCallback latency_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_freewheel(jack_client_t* client, bool onoff); | |||
| JACKBRIDGE_API bool jackbridge_set_buffer_size(jack_client_t* client, jack_nframes_t nframes); | |||
| JACKBRIDGE_API jack_nframes_t jackbridge_get_sample_rate(jack_client_t* client); | |||
| JACKBRIDGE_API jack_nframes_t jackbridge_get_buffer_size(jack_client_t* client); | |||
| JACKBRIDGE_API float jackbridge_cpu_load(jack_client_t* client); | |||
| JACKBRIDGE_API jack_port_t* jackbridge_port_register(jack_client_t* client, const char* port_name, const char* port_type, uint64_t flags, uint64_t buffer_size); | |||
| JACKBRIDGE_API bool jackbridge_port_unregister(jack_client_t* client, jack_port_t* port); | |||
| JACKBRIDGE_API void* jackbridge_port_get_buffer(jack_port_t* port, jack_nframes_t nframes); | |||
| JACKBRIDGE_API const char* jackbridge_port_name(const jack_port_t* port); | |||
| JACKBRIDGE_API jack_uuid_t jackbridge_port_uuid(const jack_port_t* port); | |||
| JACKBRIDGE_API const char* jackbridge_port_short_name(const jack_port_t* port); | |||
| JACKBRIDGE_API int jackbridge_port_flags(const jack_port_t* port); | |||
| JACKBRIDGE_API const char* jackbridge_port_type(const jack_port_t* port); | |||
| JACKBRIDGE_API bool jackbridge_port_is_mine(const jack_client_t* client, const jack_port_t* port); | |||
| JACKBRIDGE_API int jackbridge_port_connected(const jack_port_t* port); | |||
| JACKBRIDGE_API bool jackbridge_port_connected_to(const jack_port_t* port, const char* port_name); | |||
| JACKBRIDGE_API const char** jackbridge_port_get_connections(const jack_port_t* port); | |||
| JACKBRIDGE_API const char** jackbridge_port_get_all_connections(const jack_client_t* client, const jack_port_t* port); | |||
| JACKBRIDGE_API bool jackbridge_port_rename(jack_client_t* client, jack_port_t* port, const char* port_name); | |||
| JACKBRIDGE_API bool jackbridge_port_set_alias(jack_port_t* port, const char* alias); | |||
| JACKBRIDGE_API bool jackbridge_port_unset_alias(jack_port_t* port, const char* alias); | |||
| JACKBRIDGE_API int jackbridge_port_get_aliases(const jack_port_t* port, char* const al[2]); | |||
| JACKBRIDGE_API bool jackbridge_port_request_monitor(jack_port_t* port, bool onoff); | |||
| JACKBRIDGE_API bool jackbridge_port_request_monitor_by_name(jack_client_t* client, const char* port_name, bool onoff); | |||
| JACKBRIDGE_API bool jackbridge_port_ensure_monitor(jack_port_t* port, bool onoff); | |||
| JACKBRIDGE_API bool jackbridge_port_monitoring_input(jack_port_t* port); | |||
| JACKBRIDGE_API bool jackbridge_connect(jack_client_t* client, const char* source_port, const char* destination_port); | |||
| JACKBRIDGE_API bool jackbridge_disconnect(jack_client_t* client, const char* source_port, const char* destination_port); | |||
| JACKBRIDGE_API bool jackbridge_port_disconnect(jack_client_t* client, jack_port_t* port); | |||
| JACKBRIDGE_API int jackbridge_port_name_size(); | |||
| JACKBRIDGE_API int jackbridge_port_type_size(); | |||
| JACKBRIDGE_API uint32_t jackbridge_port_type_get_buffer_size(jack_client_t* client, const char* port_type); | |||
| JACKBRIDGE_API void jackbridge_port_get_latency_range(jack_port_t* port, uint32_t mode, jack_latency_range_t* range); | |||
| JACKBRIDGE_API void jackbridge_port_set_latency_range(jack_port_t* port, uint32_t mode, jack_latency_range_t* range); | |||
| JACKBRIDGE_API bool jackbridge_recompute_total_latencies(jack_client_t* client); | |||
| JACKBRIDGE_API const char** jackbridge_get_ports(jack_client_t* client, const char* port_name_pattern, const char* type_name_pattern, uint64_t flags); | |||
| JACKBRIDGE_API jack_port_t* jackbridge_port_by_name(jack_client_t* client, const char* port_name); | |||
| JACKBRIDGE_API jack_port_t* jackbridge_port_by_id(jack_client_t* client, jack_port_id_t port_id); | |||
| JACKBRIDGE_API void jackbridge_free(void* ptr); | |||
| JACKBRIDGE_API uint32_t jackbridge_midi_get_event_count(void* port_buffer); | |||
| JACKBRIDGE_API bool jackbridge_midi_event_get(jack_midi_event_t* event, void* port_buffer, uint32_t event_index); | |||
| JACKBRIDGE_API void jackbridge_midi_clear_buffer(void* port_buffer); | |||
| JACKBRIDGE_API bool jackbridge_midi_event_write(void* port_buffer, jack_nframes_t time, const jack_midi_data_t* data, uint32_t data_size); | |||
| JACKBRIDGE_API jack_midi_data_t* jackbridge_midi_event_reserve(void* port_buffer, jack_nframes_t time, uint32_t data_size); | |||
| JACKBRIDGE_API bool jackbridge_release_timebase(jack_client_t* client); | |||
| JACKBRIDGE_API bool jackbridge_set_sync_callback(jack_client_t* client, JackSyncCallback sync_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_set_sync_timeout(jack_client_t* client, jack_time_t timeout); | |||
| JACKBRIDGE_API bool jackbridge_set_timebase_callback(jack_client_t* client, bool conditional, JackTimebaseCallback timebase_callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_transport_locate(jack_client_t* client, jack_nframes_t frame); | |||
| JACKBRIDGE_API uint32_t jackbridge_transport_query(const jack_client_t* client, jack_position_t* pos); | |||
| JACKBRIDGE_API jack_nframes_t jackbridge_get_current_transport_frame(const jack_client_t* client); | |||
| JACKBRIDGE_API bool jackbridge_transport_reposition(jack_client_t* client, const jack_position_t* pos); | |||
| JACKBRIDGE_API void jackbridge_transport_start(jack_client_t* client); | |||
| JACKBRIDGE_API void jackbridge_transport_stop(jack_client_t* client); | |||
| JACKBRIDGE_API bool jackbridge_set_property(jack_client_t* client, jack_uuid_t subject, const char* key, const char* value, const char* type); | |||
| JACKBRIDGE_API bool jackbridge_get_property(jack_uuid_t subject, const char* key, char** value, char** type); | |||
| JACKBRIDGE_API void jackbridge_free_description(jack_description_t* desc, bool free_description_itself); | |||
| JACKBRIDGE_API bool jackbridge_get_properties(jack_uuid_t subject, jack_description_t* desc); | |||
| JACKBRIDGE_API bool jackbridge_get_all_properties(jack_description_t** descs); | |||
| JACKBRIDGE_API bool jackbridge_remove_property(jack_client_t* client, jack_uuid_t subject, const char* key); | |||
| JACKBRIDGE_API int jackbridge_remove_properties(jack_client_t* client, jack_uuid_t subject); | |||
| JACKBRIDGE_API bool jackbridge_remove_all_properties(jack_client_t* client); | |||
| JACKBRIDGE_API bool jackbridge_set_property_change_callback(jack_client_t* client, JackPropertyChangeCallback callback, void* arg); | |||
| JACKBRIDGE_API bool jackbridge_sem_init(void* sem) noexcept; | |||
| JACKBRIDGE_API void jackbridge_sem_destroy(void* sem) noexcept; | |||
| JACKBRIDGE_API bool jackbridge_sem_connect(void* sem) noexcept; | |||
| JACKBRIDGE_API void jackbridge_sem_post(void* sem, bool server) noexcept; | |||
| JACKBRIDGE_API bool jackbridge_sem_timedwait(void* sem, uint msecs, bool server) noexcept; | |||
| JACKBRIDGE_API bool jackbridge_shm_is_valid(const void* shm) noexcept; | |||
| JACKBRIDGE_API void jackbridge_shm_init(void* shm) noexcept; | |||
| JACKBRIDGE_API void jackbridge_shm_attach(void* shm, const char* name) noexcept; | |||
| JACKBRIDGE_API void jackbridge_shm_close(void* shm) noexcept; | |||
| JACKBRIDGE_API void* jackbridge_shm_map(void* shm, uint64_t size) noexcept; | |||
| JACKBRIDGE_API void jackbridge_shm_unmap(void* shm, void* ptr) noexcept; | |||
| JACKBRIDGE_API void jackbridge_parent_deathsig(bool kill) noexcept; | |||
| #endif // JACKBRIDGE_HPP_INCLUDED | |||
| @@ -0,0 +1,257 @@ | |||
| #!/usr/bin/make -f | |||
| # Makefile for jackbridge # | |||
| # ----------------------- # | |||
| # Created by falkTX | |||
| # | |||
| CWD=.. | |||
| MODULENAME=jackbridge | |||
| include ../modules/Makefile.mk | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| BUILD_CXX_FLAGS += $(JACKBRIDGE_FLAGS) | |||
| LINK_FLAGS += $(JACKBRIDGE_LIBS) | |||
| WINE_32BIT_FLAGS = $(32BIT_FLAGS) -fpermissive | |||
| WINE_64BIT_FLAGS = $(64BIT_FLAGS) -fpermissive | |||
| WINE_LINK_FLAGS = $(LINK_FLAGS) $(LIBDL_LIBS) -lpthread -lstdc++ | |||
| ifeq ($(JACKBRIDGE_DIRECT),true) | |||
| BUILD_CXX_FLAGS += $(JACK_FLAGS) -DJACKBRIDGE_DIRECT | |||
| LINK_FLAGS += $(JACK_LIBS) | |||
| endif | |||
| ifneq ($(MACOS),true) | |||
| WINE_32BIT_FLAGS += -I/usr/include/wine/wine/windows | |||
| WINE_32BIT_FLAGS += -I/usr/include/wine-development/windows | |||
| WINE_32BIT_FLAGS += -I/opt/wine-devel/include/wine/windows | |||
| WINE_32BIT_FLAGS += -L/usr/lib32/wine | |||
| WINE_32BIT_FLAGS += -L/usr/lib/wine | |||
| WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine | |||
| WINE_32BIT_FLAGS += -L/usr/lib/i386-linux-gnu/wine-development | |||
| WINE_32BIT_FLAGS += -L/opt/wine-stable/lib | |||
| WINE_32BIT_FLAGS += -L/opt/wine-stable/lib/wine | |||
| WINE_32BIT_FLAGS += -L/opt/wine-staging/lib | |||
| WINE_32BIT_FLAGS += -L/opt/wine-staging/lib/wine | |||
| WINE_64BIT_FLAGS += -I/usr/include/wine/wine/windows | |||
| WINE_64BIT_FLAGS += -I/usr/include/wine-development/windows | |||
| WINE_64BIT_FLAGS += -I/opt/wine-devel/include/wine/windows | |||
| WINE_64BIT_FLAGS += -L/usr/lib64/wine | |||
| WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine | |||
| WINE_64BIT_FLAGS += -L/usr/lib/x86_64-linux-gnu/wine-development | |||
| WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64 | |||
| WINE_64BIT_FLAGS += -L/opt/wine-stable/lib64/wine | |||
| WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64 | |||
| WINE_64BIT_FLAGS += -L/opt/wine-staging/lib64/wine | |||
| WINE_LINK_FLAGS += -lrt | |||
| endif | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| OBJS = $(OBJDIR)/JackBridge1.cpp.o $(OBJDIR)/JackBridge2.cpp.o | |||
| OBJS_arm32 = $(OBJDIR)/JackBridge1.cpp.arm32.o $(OBJDIR)/JackBridge2.cpp.arm32.o | |||
| OBJS_posix32 = $(OBJDIR)/JackBridge1.cpp.posix32.o $(OBJDIR)/JackBridge2.cpp.posix32.o | |||
| OBJS_posix64 = $(OBJDIR)/JackBridge1.cpp.posix64.o $(OBJDIR)/JackBridge2.cpp.posix64.o | |||
| OBJS_win32 = $(OBJDIR)/JackBridge1.cpp.win32.o $(OBJDIR)/JackBridge2.cpp.win32.o | |||
| OBJS_win64 = $(OBJDIR)/JackBridge1.cpp.win64.o $(OBJDIR)/JackBridge2.cpp.win64.o | |||
| OBJS_wine32 = $(OBJDIR)/JackBridge1.cpp.wine32.o $(OBJDIR)/JackBridge2.cpp.wine32.o $(OBJDIR)/JackBridge3.cpp.wine32.o | |||
| OBJS_wine64 = $(OBJDIR)/JackBridge1.cpp.wine64.o $(OBJDIR)/JackBridge2.cpp.wine64.o $(OBJDIR)/JackBridge3.cpp.wine64.o | |||
| OBJS_posix32e = $(OBJDIR)/JackBridgeExport.cpp.posix32e.o | |||
| OBJS_posix64e = $(OBJDIR)/JackBridgeExport.cpp.posix64e.o | |||
| OBJS_win64e = $(OBJDIR)/JackBridgeExport.cpp.win64e.o | |||
| OBJS_win32e = $(OBJDIR)/JackBridgeExport.cpp.win32e.o | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| all: $(MODULEDIR)/$(MODULENAME).a | |||
| ifeq ($(WIN32),true) | |||
| posix32: | |||
| posix64: | |||
| posix32e: | |||
| posix64e: | |||
| win32: $(MODULEDIR)/$(MODULENAME).win32.a | |||
| win64: $(MODULEDIR)/$(MODULENAME).win64.a | |||
| win32e: $(MODULEDIR)/$(MODULENAME).win32e.a | |||
| win64e: $(MODULEDIR)/$(MODULENAME).win64e.a | |||
| wine32: | |||
| wine64: | |||
| else | |||
| arm32: $(MODULEDIR)/$(MODULENAME).arm32.a | |||
| posix32: $(MODULEDIR)/$(MODULENAME).posix32.a | |||
| posix64: $(MODULEDIR)/$(MODULENAME).posix64.a | |||
| posix32e: $(MODULEDIR)/$(MODULENAME).posix32e.a | |||
| posix64e: $(MODULEDIR)/$(MODULENAME).posix64e.a | |||
| win32: | |||
| win64: | |||
| win32e: | |||
| win64e: | |||
| wine32: $(MODULEDIR)/$(MODULENAME)-wine32.dll$(LIB_EXT) | |||
| wine64: $(MODULEDIR)/$(MODULENAME)-wine64.dll$(LIB_EXT) | |||
| endif | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| clean: | |||
| rm -f $(OBJDIR)/*.o $(MODULEDIR)/$(MODULENAME)*.* | |||
| debug: | |||
| $(MAKE) DEBUG=true | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| $(MODULEDIR)/$(MODULENAME).a: $(OBJS) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| $(MODULEDIR)/$(MODULENAME).arm32.a: $(OBJS_arm32) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).arm32.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| $(MODULEDIR)/$(MODULENAME).posix32.a: $(OBJS_posix32) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).posix32.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| $(MODULEDIR)/$(MODULENAME).posix64.a: $(OBJS_posix64) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).posix64.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| $(MODULEDIR)/$(MODULENAME).win32.a: $(OBJS_win32) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).win32.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| $(MODULEDIR)/$(MODULENAME).win64.a: $(OBJS_win64) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).win64.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| $(MODULEDIR)/$(MODULENAME).posix32e.a: $(OBJS_posix32e) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).posix32e.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| $(MODULEDIR)/$(MODULENAME).posix64e.a: $(OBJS_posix64e) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).posix64e.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| $(MODULEDIR)/$(MODULENAME).win32e.a: $(OBJS_win32e) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).win32e.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| $(MODULEDIR)/$(MODULENAME).win64e.a: $(OBJS_win64e) | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Creating $(MODULENAME).win64e.a" | |||
| @rm -f $@ | |||
| @$(AR) crs $@ $^ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| $(MODULEDIR)/$(MODULENAME)-wine32.dll$(LIB_EXT): $(OBJS_wine32) JackBridgeExport.def | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Linking $(MODULENAME)-wine32.dll$(LIB_EXT)" | |||
| @$(WINECC) $^ $(WINE_32BIT_FLAGS) $(WINE_LINK_FLAGS) $(SHARED) -o $@ | |||
| $(MODULEDIR)/$(MODULENAME)-wine64.dll$(LIB_EXT): $(OBJS_wine64) JackBridgeExport.def | |||
| -@mkdir -p $(MODULEDIR) | |||
| @echo "Linking $(MODULENAME)-wine64.dll$(LIB_EXT)" | |||
| @$(WINECC) $^ $(WINE_64BIT_FLAGS) $(WINE_LINK_FLAGS) $(SHARED) -o $@ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| $(OBJDIR)/JackBridge1.cpp.o: JackBridge1.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling JackBridge1.cpp" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
| $(OBJDIR)/JackBridge2.cpp.o: JackBridge2.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling JackBridge2.cpp" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) -c -o $@ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| $(OBJDIR)/JackBridgeExport.cpp.%32e.o: JackBridgeExport.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $<" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -fpermissive -c -o $@ | |||
| $(OBJDIR)/JackBridgeExport.cpp.%64e.o: JackBridgeExport.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $<" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -fpermissive -c -o $@ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| $(OBJDIR)/%.cpp.arm32.o: %.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $< (arm32)" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) $(ARM32_FLAGS) -c -o $@ | |||
| $(OBJDIR)/%.cpp.posix32.o: %.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $< (posix32)" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@ | |||
| $(OBJDIR)/%.cpp.posix64.o: %.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $< (posix64)" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@ | |||
| $(OBJDIR)/%.cpp.win32.o: %.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $< (win32)" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) $(32BIT_FLAGS) -c -o $@ | |||
| $(OBJDIR)/%.cpp.win64.o: %.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $< (win64)" | |||
| @$(CXX) $< $(BUILD_CXX_FLAGS) $(64BIT_FLAGS) -c -o $@ | |||
| $(OBJDIR)/%.cpp.wine32.o: %.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $< (wine32)" | |||
| @$(WINECC) $< $(BUILD_CXX_FLAGS) $(WINE_32BIT_FLAGS) -c -o $@ | |||
| $(OBJDIR)/%.cpp.wine64.o: %.cpp | |||
| -@mkdir -p $(OBJDIR) | |||
| @echo "Compiling $< (wine64)" | |||
| @$(WINECC) $< $(BUILD_CXX_FLAGS) $(WINE_64BIT_FLAGS) -c -o $@ | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| -include $(OBJS:%.o=%.d) | |||
| -include $(OBJS_arm32:%.o=%.d) | |||
| -include $(OBJS_posix32:%.o=%.d) | |||
| -include $(OBJS_posix32e:%.o=%.d) | |||
| -include $(OBJS_posix64:%.o=%.d) | |||
| -include $(OBJS_posix64e:%.o=%.d) | |||
| -include $(OBJS_win32:%.o=%.d) | |||
| -include $(OBJS_win32e:%.o=%.d) | |||
| -include $(OBJS_win64:%.o=%.d) | |||
| -include $(OBJS_win64e:%.o=%.d) | |||
| -include $(OBJS_wine32:%.o=%.d) | |||
| -include $(OBJS_wine64:%.o=%.d) | |||
| # --------------------------------------------------------------------------------------------------------------------- | |||
| @@ -26,11 +26,9 @@ include ../../Makefile.plugins.mk | |||
| # -------------------------------------------------------------- | |||
| # Enable all possible plugin types | |||
| ifeq ($(HAVE_JACK),true) | |||
| ifeq ($(HAVE_OPENGL),true) | |||
| TARGETS += jack | |||
| endif # HAVE_OPENGL | |||
| endif # HAVE_JACK | |||
| ifeq ($(HAVE_OPENGL),true) | |||
| TARGETS += lv2_sep | |||