Browse Source

Start fixup of wine bridge

tags/1.9.7
falkTX 9 years ago
parent
commit
4fa392bd3b
6 changed files with 824 additions and 410 deletions
  1. +29
    -22
      source/backend/engine/CarlaEngineJack.cpp
  2. +146
    -144
      source/jackbridge/JackBridge.hpp
  3. +519
    -126
      source/jackbridge/JackBridge1.cpp
  4. +5
    -2
      source/jackbridge/JackBridge3.cpp
  5. +20
    -10
      source/jackbridge/JackBridgeExport.cpp
  6. +105
    -106
      source/jackbridge/JackBridgeExport.hpp

+ 29
- 22
source/backend/engine/CarlaEngineJack.cpp View File

@@ -35,10 +35,6 @@
// must be last
#include "jackbridge/JackBridge.hpp"

#ifndef __cdecl
# define __cdecl
#endif

#define URI_CANVAS_ICON "http://kxstudio.sf.net/ns/canvas/icon"

using juce::FloatVectorOperations;
@@ -1878,9 +1874,9 @@ protected:
// -------------------------------------------------------------------

private:
jack_client_t* fClient;
jack_position_t fTransportPos;
jack_transport_state_t fTransportState;
jack_client_t* fClient;
jack_position_t fTransportPos;
uint32_t fTransportState;
bool fExternalPatchbay;
bool fFreewheel;

@@ -2192,7 +2188,7 @@ private:

#define handlePtr ((CarlaEngineJack*)arg)

static void __cdecl carla_jack_thread_init_callback(void*)
static void JACKBRIDGE_API carla_jack_thread_init_callback(void*)
{
#ifdef __SSE2_MATH__
// Set FTZ and DAZ flags
@@ -2200,66 +2196,77 @@ private:
#endif
}

static int __cdecl carla_jack_bufsize_callback(jack_nframes_t newBufferSize, void* arg)
static int JACKBRIDGE_API carla_jack_bufsize_callback(jack_nframes_t newBufferSize, void* arg)
{
carla_stdout("JACK %s", __FUNCTION__);
carla_stdout("JACK bufSize %i", newBufferSize);
carla_stdout("JACK bufSize %p", arg);
handlePtr->handleJackBufferSizeCallback(newBufferSize);
return 0;
}

static int __cdecl carla_jack_srate_callback(jack_nframes_t newSampleRate, void* arg)
static int JACKBRIDGE_API carla_jack_srate_callback(jack_nframes_t newSampleRate, void* arg)
{
carla_stdout("JACK %s", __FUNCTION__);
carla_stdout("JACK srate %i", newSampleRate);
carla_stdout("JACK srate %p", arg);
handlePtr->handleJackSampleRateCallback(newSampleRate);
return 0;
}

static void __cdecl carla_jack_freewheel_callback(int starting, void* arg)
static void JACKBRIDGE_API carla_jack_freewheel_callback(int starting, void* arg)
{
carla_stdout("JACK %s", __FUNCTION__);
handlePtr->handleJackFreewheelCallback(bool(starting));
}

static int __cdecl carla_jack_process_callback(jack_nframes_t nframes, void* arg) __attribute__((annotate("realtime")))
static int JACKBRIDGE_API carla_jack_process_callback(jack_nframes_t nframes, void* arg) __attribute__((annotate("realtime")))
{
carla_stdout("PROCESS CALLBACK START");
handlePtr->handleJackProcessCallback(nframes);
carla_stdout("PROCESS CALLBACK END");
return 0;
}

static void __cdecl carla_jack_latency_callback(jack_latency_callback_mode_t mode, void* arg)
static void JACKBRIDGE_API carla_jack_latency_callback(jack_latency_callback_mode_t mode, void* arg)
{
carla_stdout("JACK %s", __FUNCTION__);
handlePtr->handleJackLatencyCallback(mode);
}

#ifndef BUILD_BRIDGE
static void __cdecl carla_jack_client_registration_callback(const char* name, int reg, void* arg)
static void JACKBRIDGE_API carla_jack_client_registration_callback(const char* name, int reg, void* arg)
{
handlePtr->handleJackClientRegistrationCallback(name, (reg != 0));
}

static void __cdecl carla_jack_port_registration_callback(jack_port_id_t port, int reg, void* arg)
static void JACKBRIDGE_API carla_jack_port_registration_callback(jack_port_id_t port, int reg, void* arg)
{
handlePtr->handleJackPortRegistrationCallback(port, (reg != 0));
}

static void __cdecl carla_jack_port_connect_callback(jack_port_id_t a, jack_port_id_t b, int connect, void* arg)
static void JACKBRIDGE_API carla_jack_port_connect_callback(jack_port_id_t a, jack_port_id_t b, int connect, void* arg)
{
handlePtr->handleJackPortConnectCallback(a, b, (connect != 0));
}

static int __cdecl carla_jack_client_rename_callback(const char* oldName, const char* newName, void* arg)
static int JACKBRIDGE_API carla_jack_client_rename_callback(const char* oldName, const char* newName, void* arg)
{
handlePtr->handleJackClientRenameCallback(oldName, newName);
return 0;
}

// NOTE: JACK1 returns void, JACK2 returns int
static int __cdecl carla_jack_port_rename_callback(jack_port_id_t port, const char* oldName, const char* newName, void* arg)
static int JACKBRIDGE_API carla_jack_port_rename_callback(jack_port_id_t port, const char* oldName, const char* newName, void* arg)
{
handlePtr->handleJackPortRenameCallback(port, oldName, newName);
return 0;
}
#endif

static void __cdecl carla_jack_shutdown_callback(void* arg)
static void JACKBRIDGE_API carla_jack_shutdown_callback(void* arg)
{
carla_stdout("JACK %s", __FUNCTION__);
handlePtr->handleJackShutdownCallback();
}

@@ -2268,7 +2275,7 @@ private:
// -------------------------------------------------------------------

#ifndef BUILD_BRIDGE
static int __cdecl carla_jack_process_callback_plugin(jack_nframes_t nframes, void* arg) __attribute__((annotate("realtime")))
static int JACKBRIDGE_API carla_jack_process_callback_plugin(jack_nframes_t nframes, void* arg) __attribute__((annotate("realtime")))
{
CarlaPlugin* const plugin((CarlaPlugin*)arg);
CARLA_SAFE_ASSERT_RETURN(plugin != nullptr && plugin->isEnabled(), 0);
@@ -2287,12 +2294,12 @@ private:
return 0;
}

static void __cdecl carla_jack_latency_callback_plugin(jack_latency_callback_mode_t /*mode*/, void* /*arg*/)
static void JACKBRIDGE_API carla_jack_latency_callback_plugin(jack_latency_callback_mode_t /*mode*/, void* /*arg*/)
{
// TODO
}

static void __cdecl carla_jack_shutdown_callback_plugin(void* arg)
static void JACKBRIDGE_API carla_jack_shutdown_callback_plugin(void* arg)
{
CarlaPlugin* const plugin((CarlaPlugin*)arg);
CARLA_SAFE_ASSERT_RETURN(plugin != nullptr,);


+ 146
- 144
source/jackbridge/JackBridge.hpp View File

@@ -29,10 +29,6 @@
# undef __WIN64__
#endif

#ifndef __cdecl
# define __cdecl
#endif

#include "CarlaDefines.h"

#ifdef JACKBRIDGE_DIRECT
@@ -44,6 +40,12 @@

#include <cstddef>

#if (defined(CARLA_OS_WIN) && ! defined(BUILDING_CARLA_FOR_WINDOWS)) || defined(__WINE__)
# define JACKBRIDGE_API __cdecl
#else
# define JACKBRIDGE_API
#endif

#ifdef CARLA_PROPER_CPP11_SUPPORT
# include <cstdint>
#else
@@ -255,150 +257,150 @@ 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 (__cdecl *JackLatencyCallback)(jack_latency_callback_mode_t mode, void* arg);
typedef int (__cdecl *JackProcessCallback)(jack_nframes_t nframes, void* arg);
typedef void (__cdecl *JackThreadInitCallback)(void* arg);
typedef int (__cdecl *JackGraphOrderCallback)(void* arg);
typedef int (__cdecl *JackXRunCallback)(void* arg);
typedef int (__cdecl *JackBufferSizeCallback)(jack_nframes_t nframes, void* arg);
typedef int (__cdecl *JackSampleRateCallback)(jack_nframes_t nframes, void* arg);
typedef void (__cdecl *JackPortRegistrationCallback)(jack_port_id_t port, int register_, void* arg);
typedef void (__cdecl *JackClientRegistrationCallback)(const char* name, int register_, void* arg);
typedef void (__cdecl *JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
typedef int (__cdecl *JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void* arg); // NOTE: returns void in JACK1, int in JACK2
typedef void (__cdecl *JackFreewheelCallback)(int starting, void* arg);
typedef void (__cdecl *JackShutdownCallback)(void* arg);
typedef void (__cdecl *JackInfoShutdownCallback)(jack_status_t code, const char* reason, void* arg);
typedef int (__cdecl *JackSyncCallback)(jack_transport_state_t state, jack_position_t* pos, void* arg);
typedef void (__cdecl *JackTimebaseCallback)(jack_transport_state_t state, jack_nframes_t nframes, jack_position_t* pos, int new_pos, void* arg);
typedef void (__cdecl *JackSessionCallback)(jack_session_event_t* event, void* arg);
typedef void (__cdecl *JackPropertyChangeCallback)(jack_uuid_t subject, const char* key, jack_property_change_t change, void* arg);
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 int (JACKBRIDGE_API *JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void* arg); // NOTE: returns void in JACK1, int in JACK2
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

__cdecl bool jackbridge_is_ok() noexcept;
__cdecl void jackbridge_get_version(int* major_ptr, int* minor_ptr, int* micro_ptr, int* proto_ptr);
__cdecl const char* jackbridge_get_version_string();
__cdecl jack_client_t* jackbridge_client_open(const char* client_name, jack_options_t options, jack_status_t* status);
__cdecl bool jackbridge_client_close(jack_client_t* client);
__cdecl int jackbridge_client_name_size();
__cdecl char* jackbridge_get_client_name(jack_client_t* client);
__cdecl char* jackbridge_get_uuid_for_client_name(jack_client_t* client, const char* name);
__cdecl char* jackbridge_get_client_name_by_uuid(jack_client_t* client, const char* uuid);
__cdecl bool jackbridge_activate(jack_client_t* client);
__cdecl bool jackbridge_deactivate(jack_client_t* client);
__cdecl bool jackbridge_is_realtime(jack_client_t* client);
__cdecl bool jackbridge_set_thread_init_callback(jack_client_t* client, JackThreadInitCallback thread_init_callback, void* arg);
__cdecl void jackbridge_on_shutdown(jack_client_t* client, JackShutdownCallback shutdown_callback, void* arg);
__cdecl void jackbridge_on_info_shutdown(jack_client_t* client, JackInfoShutdownCallback shutdown_callback, void* arg);
__cdecl bool jackbridge_set_process_callback(jack_client_t* client, JackProcessCallback process_callback, void* arg);
__cdecl bool jackbridge_set_freewheel_callback(jack_client_t* client, JackFreewheelCallback freewheel_callback, void* arg);
__cdecl bool jackbridge_set_buffer_size_callback(jack_client_t* client, JackBufferSizeCallback bufsize_callback, void* arg);
__cdecl bool jackbridge_set_sample_rate_callback(jack_client_t* client, JackSampleRateCallback srate_callback, void* arg);
__cdecl bool jackbridge_set_client_registration_callback(jack_client_t* client, JackClientRegistrationCallback registration_callback, void* arg);
__cdecl bool jackbridge_set_port_registration_callback(jack_client_t* client, JackPortRegistrationCallback registration_callback, void* arg);
__cdecl bool jackbridge_set_port_rename_callback(jack_client_t* client, JackPortRenameCallback rename_callback, void* arg);
__cdecl bool jackbridge_set_port_connect_callback(jack_client_t* client, JackPortConnectCallback connect_callback, void* arg);
__cdecl bool jackbridge_set_graph_order_callback(jack_client_t* client, JackGraphOrderCallback graph_callback, void* arg);
__cdecl bool jackbridge_set_xrun_callback(jack_client_t* client, JackXRunCallback xrun_callback, void* arg);
__cdecl bool jackbridge_set_latency_callback(jack_client_t* client, JackLatencyCallback latency_callback, void* arg);
__cdecl bool jackbridge_set_freewheel(jack_client_t* client, bool onoff);
__cdecl bool jackbridge_set_buffer_size(jack_client_t* client, jack_nframes_t nframes);
__cdecl jack_nframes_t jackbridge_get_sample_rate(jack_client_t* client);
__cdecl jack_nframes_t jackbridge_get_buffer_size(jack_client_t* client);
__cdecl float jackbridge_cpu_load(jack_client_t* client);
__cdecl jack_port_t* jackbridge_port_register(jack_client_t* client, const char* port_name, const char* port_type, ulong flags, ulong buffer_size);
__cdecl bool jackbridge_port_unregister(jack_client_t* client, jack_port_t* port);
__cdecl void* jackbridge_port_get_buffer(jack_port_t* port, jack_nframes_t nframes);
__cdecl const char* jackbridge_port_name(const jack_port_t* port);
__cdecl jack_uuid_t jackbridge_port_uuid(const jack_port_t* port);
__cdecl const char* jackbridge_port_short_name(const jack_port_t* port);
__cdecl int jackbridge_port_flags(const jack_port_t* port);
__cdecl const char* jackbridge_port_type(const jack_port_t* port);
__cdecl bool jackbridge_port_is_mine(const jack_client_t* client, const jack_port_t* port);
__cdecl int jackbridge_port_connected(const jack_port_t* port);
__cdecl bool jackbridge_port_connected_to(const jack_port_t* port, const char* port_name);
__cdecl const char** jackbridge_port_get_connections(const jack_port_t* port);
__cdecl const char** jackbridge_port_get_all_connections(const jack_client_t* client, const jack_port_t* port);
__cdecl bool jackbridge_port_set_name(jack_port_t* port, const char* port_name);
__cdecl bool jackbridge_port_set_alias(jack_port_t* port, const char* alias);
__cdecl bool jackbridge_port_unset_alias(jack_port_t* port, const char* alias);
__cdecl int jackbridge_port_get_aliases(const jack_port_t* port, char* const aliases[2]);
__cdecl bool jackbridge_port_request_monitor(jack_port_t* port, bool onoff);
__cdecl bool jackbridge_port_request_monitor_by_name(jack_client_t* client, const char* port_name, bool onoff);
__cdecl bool jackbridge_port_ensure_monitor(jack_port_t* port, bool onoff);
__cdecl bool jackbridge_port_monitoring_input(jack_port_t* port);
__cdecl bool jackbridge_connect(jack_client_t* client, const char* source_port, const char* destination_port);
__cdecl bool jackbridge_disconnect(jack_client_t* client, const char* source_port, const char* destination_port);
__cdecl bool jackbridge_port_disconnect(jack_client_t* client, jack_port_t* port);
__cdecl int jackbridge_port_name_size();
__cdecl int jackbridge_port_type_size();
__cdecl size_t jackbridge_port_type_get_buffer_size(jack_client_t* client, const char* port_type);
__cdecl void jackbridge_port_get_latency_range(jack_port_t* port, jack_latency_callback_mode_t mode, jack_latency_range_t* range);
__cdecl void jackbridge_port_set_latency_range(jack_port_t* port, jack_latency_callback_mode_t mode, jack_latency_range_t* range);
__cdecl bool jackbridge_recompute_total_latencies(jack_client_t* client);
__cdecl const char** jackbridge_get_ports(jack_client_t* client, const char* port_name_pattern, const char* type_name_pattern, ulong flags);
__cdecl jack_port_t* jackbridge_port_by_name(jack_client_t* client, const char* port_name);
__cdecl jack_port_t* jackbridge_port_by_id(jack_client_t* client, jack_port_id_t port_id);
__cdecl void jackbridge_free(void* ptr);
__cdecl uint32_t jackbridge_midi_get_event_count(void* port_buffer);
__cdecl bool jackbridge_midi_event_get(jack_midi_event_t* event, void* port_buffer, uint32_t event_index);
__cdecl void jackbridge_midi_clear_buffer(void* port_buffer);
__cdecl bool jackbridge_midi_event_write(void* port_buffer, jack_nframes_t time, const jack_midi_data_t* data, size_t data_size);
__cdecl jack_midi_data_t* jackbridge_midi_event_reserve(void* port_buffer, jack_nframes_t time, size_t data_size);
__cdecl bool jackbridge_release_timebase(jack_client_t* client);
__cdecl bool jackbridge_set_sync_callback(jack_client_t* client, JackSyncCallback sync_callback, void* arg);
__cdecl bool jackbridge_set_sync_timeout(jack_client_t* client, jack_time_t timeout);
__cdecl bool jackbridge_set_timebase_callback(jack_client_t* client, bool conditional, JackTimebaseCallback timebase_callback, void* arg);
__cdecl bool jackbridge_transport_locate(jack_client_t* client, jack_nframes_t frame);
__cdecl jack_transport_state_t jackbridge_transport_query(const jack_client_t* client, jack_position_t* pos);
__cdecl jack_nframes_t jackbridge_get_current_transport_frame(const jack_client_t* client);
__cdecl bool jackbridge_transport_reposition(jack_client_t* client, const jack_position_t* pos);
__cdecl void jackbridge_transport_start(jack_client_t* client);
__cdecl void jackbridge_transport_stop(jack_client_t* client);
__cdecl bool jackbridge_set_property(jack_client_t* client, jack_uuid_t subject, const char* key, const char* value, const char* type);
__cdecl bool jackbridge_get_property(jack_uuid_t subject, const char* key, char** value, char** type);
__cdecl void jackbridge_free_description(jack_description_t* desc, bool free_description_itself);
__cdecl bool jackbridge_get_properties(jack_uuid_t subject, jack_description_t* desc);
__cdecl bool jackbridge_get_all_properties(jack_description_t** descs);
__cdecl bool jackbridge_remove_property(jack_client_t* client, jack_uuid_t subject, const char* key);
__cdecl int jackbridge_remove_properties(jack_client_t* client, jack_uuid_t subject);
__cdecl bool jackbridge_remove_all_properties(jack_client_t* client);
__cdecl bool jackbridge_set_property_change_callback(jack_client_t* client, JackPropertyChangeCallback callback, void* arg);
__cdecl bool jackbridge_sem_init(void* sem) noexcept;
__cdecl void jackbridge_sem_destroy(void* sem) noexcept;
__cdecl void jackbridge_sem_post(void* sem) noexcept;
__cdecl bool jackbridge_sem_timedwait(void* sem, uint secs) noexcept;
__cdecl bool jackbridge_shm_is_valid(const void* shm) noexcept;
__cdecl void jackbridge_shm_init(void* shm) noexcept;
__cdecl void jackbridge_shm_attach(void* shm, const char* name) noexcept;
__cdecl void jackbridge_shm_close(void* shm) noexcept;
__cdecl void* jackbridge_shm_map(void* shm, uint64_t size) noexcept;
JACKBRIDGE_API bool jackbridge_is_ok() noexcept;
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_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_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_set_name(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 aliases[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 void jackbridge_sem_post(void* sem) noexcept;
JACKBRIDGE_API bool jackbridge_sem_timedwait(void* sem, uint secs) 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;

#endif // JACKBRIDGE_HPP_INCLUDED

+ 519
- 126
source/jackbridge/JackBridge1.cpp
File diff suppressed because it is too large
View File


+ 5
- 2
source/jackbridge/JackBridge3.cpp View File

@@ -29,12 +29,15 @@
// -----------------------------------------------------------------------------

JACKBRIDGE_EXPORT
const JackBridgeExportedFunctions* jackbridge_get_exported_functions()
const JackBridgeExportedFunctions* JACKBRIDGE_API jackbridge_get_exported_functions()
{
static JackBridgeExportedFunctions funcs;
carla_zeroStruct(funcs);

funcs.unique1 = funcs.unique2 = 0xdeadf00d;
funcs.unique1 = funcs.unique2 = funcs.unique3 = 0xdeadf00d;
carla_stdout("WINE jackbridge_get_exported_functions() called, data: %lu %lu %lu", funcs.unique1, funcs.unique2, funcs.unique3);
carla_stdout("WINE jackbridge_get_exported_functions() %p %p %p %lu", &funcs.unique1, &funcs.unique2, &funcs.unique3,
uintptr_t(&funcs.unique3) - uintptr_t(&funcs.unique1));

funcs.get_version_ptr = jackbridge_get_version;
funcs.get_version_string_ptr = jackbridge_get_version_string;


+ 20
- 10
source/jackbridge/JackBridgeExport.cpp View File

@@ -52,7 +52,9 @@ public:
{
static JackBridgeExportedFunctions fallback;
carla_zeroStruct(fallback);
++fallback.unique2;
fallback.unique1 = 1;
fallback.unique2 = 2;
fallback.unique3 = 3;

static const JackBridgeExported bridge;
CARLA_SAFE_ASSERT_RETURN(bridge.func != nullptr, fallback);
@@ -60,7 +62,15 @@ public:
const JackBridgeExportedFunctions* const funcs(bridge.func());
CARLA_SAFE_ASSERT_RETURN(funcs != nullptr, fallback);
CARLA_SAFE_ASSERT_RETURN(funcs->unique1 != 0, fallback);
carla_stdout("unique1: %lu", funcs->unique1);
carla_stdout("unique2: %lu", funcs->unique2);
carla_stdout("unique3: %lu", funcs->unique3);

carla_stdout("WINDOWS get_exported_functions() %p %p %p %lu", &funcs->unique1, &funcs->unique2, &funcs->unique3,
uintptr_t(&funcs->unique3) - uintptr_t(&funcs->unique1));

CARLA_SAFE_ASSERT_RETURN(funcs->unique1 == funcs->unique2, fallback);
CARLA_SAFE_ASSERT_RETURN(funcs->unique2 == funcs->unique3, fallback);
CARLA_SAFE_ASSERT_RETURN(funcs->shm_map_ptr != nullptr, fallback);

return *funcs;
@@ -100,7 +110,7 @@ const char* jackbridge_get_version_string()
return getBridgeInstance().get_version_string_ptr();
}

jack_client_t* jackbridge_client_open(const char* client_name, jack_options_t options, jack_status_t* status)
jack_client_t* jackbridge_client_open(const char* client_name, uint32_t options, jack_status_t* status)
{
return getBridgeInstance().client_open_ptr(client_name, options, status);
}
@@ -235,7 +245,7 @@ float jackbridge_cpu_load(jack_client_t* client)
return getBridgeInstance().cpu_load_ptr(client);
}

jack_port_t* jackbridge_port_register(jack_client_t* client, const char* port_name, const char* port_type, ulong flags, ulong buffer_size)
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)
{
return getBridgeInstance().port_register_ptr(client, port_name, port_type, flags, buffer_size);
}
@@ -365,17 +375,17 @@ int jackbridge_port_type_size()
return getBridgeInstance().port_type_size_ptr();
}

size_t jackbridge_port_type_get_buffer_size(jack_client_t* client, const char* port_type)
uint32_t jackbridge_port_type_get_buffer_size(jack_client_t* client, const char* port_type)
{
return getBridgeInstance().port_type_get_buffer_size_ptr(client, port_type);
}

void jackbridge_port_get_latency_range(jack_port_t* port, jack_latency_callback_mode_t mode, jack_latency_range_t* range)
void jackbridge_port_get_latency_range(jack_port_t* port, uint32_t mode, jack_latency_range_t* range)
{
return getBridgeInstance().port_get_latency_range_ptr(port, mode, range);
}

void jackbridge_port_set_latency_range(jack_port_t* port, jack_latency_callback_mode_t mode, jack_latency_range_t* range)
void jackbridge_port_set_latency_range(jack_port_t* port, uint32_t mode, jack_latency_range_t* range)
{
return getBridgeInstance().port_set_latency_range_ptr(port, mode, range);
}
@@ -385,7 +395,7 @@ bool jackbridge_recompute_total_latencies(jack_client_t* client)
return getBridgeInstance().recompute_total_latencies_ptr(client);
}

const char** jackbridge_get_ports(jack_client_t* client, const char* port_name_pattern, const char* type_name_pattern, ulong flags)
const char** jackbridge_get_ports(jack_client_t* client, const char* port_name_pattern, const char* type_name_pattern, uint64_t flags)
{
return getBridgeInstance().get_ports_ptr(client, port_name_pattern, type_name_pattern, flags);
}
@@ -420,12 +430,12 @@ void jackbridge_midi_clear_buffer(void* port_buffer)
return getBridgeInstance().midi_clear_buffer_ptr(port_buffer);
}

bool jackbridge_midi_event_write(void* port_buffer, jack_nframes_t time, const jack_midi_data_t* data, size_t data_size)
bool jackbridge_midi_event_write(void* port_buffer, jack_nframes_t time, const jack_midi_data_t* data, uint32_t data_size)
{
return getBridgeInstance().midi_event_write_ptr(port_buffer, time, data, data_size);
}

jack_midi_data_t* jackbridge_midi_event_reserve(void* port_buffer, jack_nframes_t time, size_t data_size)
jack_midi_data_t* jackbridge_midi_event_reserve(void* port_buffer, jack_nframes_t time, uint32_t data_size)
{
return getBridgeInstance().midi_event_reserve_ptr(port_buffer, time, data_size);
}
@@ -455,7 +465,7 @@ bool jackbridge_transport_locate(jack_client_t* client, jack_nframes_t frame)
return getBridgeInstance().transport_locate_ptr(client, frame);
}

jack_transport_state_t jackbridge_transport_query(const jack_client_t* client, jack_position_t* pos)
uint32_t jackbridge_transport_query(const jack_client_t* client, jack_position_t* pos)
{
return getBridgeInstance().transport_query_ptr(client, pos);
}


+ 105
- 106
source/jackbridge/JackBridgeExport.hpp View File

@@ -16,113 +16,111 @@

#include "JackBridge.hpp"

// -----------------------------------------------------------------------------

extern "C" {

typedef void (__cdecl *jackbridgesym_get_version)(int* major_ptr, int* minor_ptr, int* micro_ptr, int* proto_ptr);
typedef const char* (__cdecl *jackbridgesym_get_version_string)(void);
typedef jack_client_t* (__cdecl *jackbridgesym_client_open)(const char* client_name, jack_options_t options, jack_status_t* status);
typedef bool (__cdecl *jackbridgesym_client_close)(jack_client_t* client);
typedef int (__cdecl *jackbridgesym_client_name_size)(void);
typedef char* (__cdecl *jackbridgesym_get_client_name)(jack_client_t* client);
typedef char* (__cdecl *jackbridgesym_get_uuid_for_client_name)(jack_client_t* client, const char* name);
typedef char* (__cdecl *jackbridgesym_get_client_name_by_uuid)(jack_client_t* client, const char* uuid);
typedef bool (__cdecl *jackbridgesym_activate)(jack_client_t* client);
typedef bool (__cdecl *jackbridgesym_deactivate)(jack_client_t* client);
typedef bool (__cdecl *jackbridgesym_is_realtime)(jack_client_t* client);
typedef bool (__cdecl *jackbridgesym_set_thread_init_callback)(jack_client_t* client, JackThreadInitCallback thread_init_callback, void* arg);
typedef void (__cdecl *jackbridgesym_on_shutdown)(jack_client_t* client, JackShutdownCallback shutdown_callback, void* arg);
typedef void (__cdecl *jackbridgesym_on_info_shutdown)(jack_client_t* client, JackInfoShutdownCallback shutdown_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_process_callback)(jack_client_t* client, JackProcessCallback process_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_freewheel_callback)(jack_client_t* client, JackFreewheelCallback freewheel_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_buffer_size_callback)(jack_client_t* client, JackBufferSizeCallback bufsize_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_sample_rate_callback)(jack_client_t* client, JackSampleRateCallback srate_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_client_registration_callback)(jack_client_t* client, JackClientRegistrationCallback registration_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_port_registration_callback)(jack_client_t* client, JackPortRegistrationCallback registration_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_port_rename_callback)(jack_client_t* client, JackPortRenameCallback rename_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_port_connect_callback)(jack_client_t* client, JackPortConnectCallback connect_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_graph_order_callback)(jack_client_t* client, JackGraphOrderCallback graph_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_xrun_callback)(jack_client_t* client, JackXRunCallback xrun_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_latency_callback)(jack_client_t* client, JackLatencyCallback latency_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_freewheel)(jack_client_t* client, bool onoff);
typedef bool (__cdecl *jackbridgesym_set_buffer_size)(jack_client_t* client, jack_nframes_t nframes);
typedef jack_nframes_t (__cdecl *jackbridgesym_get_sample_rate)(jack_client_t* client);
typedef jack_nframes_t (__cdecl *jackbridgesym_get_buffer_size)(jack_client_t* client);
typedef float (__cdecl *jackbridgesym_cpu_load)(jack_client_t* client);
typedef jack_port_t* (__cdecl *jackbridgesym_port_register)(jack_client_t* client, const char* port_name, const char* port_type, ulong flags, ulong buffer_size);
typedef bool (__cdecl *jackbridgesym_port_unregister)(jack_client_t* client, jack_port_t* port);
typedef void* (__cdecl *jackbridgesym_port_get_buffer)(jack_port_t* port, jack_nframes_t nframes);
typedef const char* (__cdecl *jackbridgesym_port_name)(const jack_port_t* port);
typedef jack_uuid_t (__cdecl *jackbridgesym_port_uuid)(const jack_port_t* port);
typedef const char* (__cdecl *jackbridgesym_port_short_name)(const jack_port_t* port);
typedef int (__cdecl *jackbridgesym_port_flags)(const jack_port_t* port);
typedef const char* (__cdecl *jackbridgesym_port_type)(const jack_port_t* port);
typedef bool (__cdecl *jackbridgesym_port_is_mine)(const jack_client_t* client, const jack_port_t* port);
typedef int (__cdecl *jackbridgesym_port_connected)(const jack_port_t* port);
typedef bool (__cdecl *jackbridgesym_port_connected_to)(const jack_port_t* port, const char* port_name);
typedef const char** (__cdecl *jackbridgesym_port_get_connections)(const jack_port_t* port);
typedef const char** (__cdecl *jackbridgesym_port_get_all_connections)(const jack_client_t* client, const jack_port_t* port);
typedef bool (__cdecl *jackbridgesym_port_set_name)(jack_port_t* port, const char* port_name);
typedef bool (__cdecl *jackbridgesym_port_set_alias)(jack_port_t* port, const char* alias);
typedef bool (__cdecl *jackbridgesym_port_unset_alias)(jack_port_t* port, const char* alias);
typedef int (__cdecl *jackbridgesym_port_get_aliases)(const jack_port_t* port, char* const aliases[2]);
typedef bool (__cdecl *jackbridgesym_port_request_monitor)(jack_port_t* port, bool onoff);
typedef bool (__cdecl *jackbridgesym_port_request_monitor_by_name)(jack_client_t* client, const char* port_name, bool onoff);
typedef bool (__cdecl *jackbridgesym_port_ensure_monitor)(jack_port_t* port, bool onoff);
typedef bool (__cdecl *jackbridgesym_port_monitoring_input)(jack_port_t* port);
typedef bool (__cdecl *jackbridgesym_connect)(jack_client_t* client, const char* source_port, const char* destination_port);
typedef bool (__cdecl *jackbridgesym_disconnect)(jack_client_t* client, const char* source_port, const char* destination_port);
typedef bool (__cdecl *jackbridgesym_port_disconnect)(jack_client_t* client, jack_port_t* port);
typedef int (__cdecl *jackbridgesym_port_name_size)(void);
typedef int (__cdecl *jackbridgesym_port_type_size)(void);
typedef size_t (__cdecl *jackbridgesym_port_type_get_buffer_size)(jack_client_t* client, const char* port_type);
typedef void (__cdecl *jackbridgesym_port_get_latency_range)(jack_port_t* port, jack_latency_callback_mode_t mode, jack_latency_range_t* range);
typedef void (__cdecl *jackbridgesym_port_set_latency_range)(jack_port_t* port, jack_latency_callback_mode_t mode, jack_latency_range_t* range);
typedef bool (__cdecl *jackbridgesym_recompute_total_latencies)(jack_client_t* client);
typedef const char** (__cdecl *jackbridgesym_get_ports)(jack_client_t* client, const char* port_name_pattern, const char* type_name_pattern, ulong flags);
typedef jack_port_t* (__cdecl *jackbridgesym_port_by_name)(jack_client_t* client, const char* port_name);
typedef jack_port_t* (__cdecl *jackbridgesym_port_by_id)(jack_client_t* client, jack_port_id_t port_id);
typedef void (__cdecl *jackbridgesym_free)(void* ptr);
typedef uint32_t (__cdecl *jackbridgesym_midi_get_event_count)(void* port_buffer);
typedef bool (__cdecl *jackbridgesym_midi_event_get)(jack_midi_event_t* event, void* port_buffer, uint32_t event_index);
typedef void (__cdecl *jackbridgesym_midi_clear_buffer)(void* port_buffer);
typedef bool (__cdecl *jackbridgesym_midi_event_write)(void* port_buffer, jack_nframes_t time, const jack_midi_data_t* data, size_t data_size);
typedef jack_midi_data_t* (__cdecl *jackbridgesym_midi_event_reserve)(void* port_buffer, jack_nframes_t time, size_t data_size);
typedef bool (__cdecl *jackbridgesym_release_timebase)(jack_client_t* client);
typedef bool (__cdecl *jackbridgesym_set_sync_callback)(jack_client_t* client, JackSyncCallback sync_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_set_sync_timeout)(jack_client_t* client, jack_time_t timeout);
typedef bool (__cdecl *jackbridgesym_set_timebase_callback)(jack_client_t* client, bool conditional, JackTimebaseCallback timebase_callback, void* arg);
typedef bool (__cdecl *jackbridgesym_transport_locate)(jack_client_t* client, jack_nframes_t frame);
typedef jack_transport_state_t (__cdecl *jackbridgesym_transport_query)(const jack_client_t* client, jack_position_t* pos);
typedef jack_nframes_t (__cdecl *jackbridgesym_get_current_transport_frame)(const jack_client_t* client);
typedef bool (__cdecl *jackbridgesym_transport_reposition)(jack_client_t* client, const jack_position_t* pos);
typedef void (__cdecl *jackbridgesym_transport_start)(jack_client_t* client);
typedef void (__cdecl *jackbridgesym_transport_stop)(jack_client_t* client);
typedef bool (__cdecl *jackbridgesym_set_property)(jack_client_t* client, jack_uuid_t subject, const char* key, const char* value, const char* type);
typedef bool (__cdecl *jackbridgesym_get_property)(jack_uuid_t subject, const char* key, char** value, char** type);
typedef void (__cdecl *jackbridgesym_free_description)(jack_description_t* desc, bool free_description_itself);
typedef bool (__cdecl *jackbridgesym_get_properties)(jack_uuid_t subject, jack_description_t* desc);
typedef bool (__cdecl *jackbridgesym_get_all_properties)(jack_description_t** descs);
typedef bool (__cdecl *jackbridgesym_remove_property)(jack_client_t* client, jack_uuid_t subject, const char* key);
typedef int (__cdecl *jackbridgesym_remove_properties)(jack_client_t* client, jack_uuid_t subject);
typedef bool (__cdecl *jackbridgesym_remove_all_properties)(jack_client_t* client);
typedef bool (__cdecl *jackbridgesym_set_property_change_callback)(jack_client_t* client, JackPropertyChangeCallback callback, void* arg);
typedef bool (__cdecl *jackbridgesym_sem_init)(void* sem);
typedef void (__cdecl *jackbridgesym_sem_destroy)(void* sem);
typedef void (__cdecl *jackbridgesym_sem_post)(void* sem);
typedef bool (__cdecl *jackbridgesym_sem_timedwait)(void* sem, uint secs);
typedef bool (__cdecl *jackbridgesym_shm_is_valid)(const void* shm);
typedef void (__cdecl *jackbridgesym_shm_init)(void* shm);
typedef void (__cdecl *jackbridgesym_shm_attach)(void* shm, const char* name);
typedef void (__cdecl *jackbridgesym_shm_close)(void* shm);
typedef void* (__cdecl *jackbridgesym_shm_map)(void* shm, uint64_t size);
// -----------------------------------------------------------------------------

} // extern "C"
typedef void (JACKBRIDGE_API *jackbridgesym_get_version)(int* major_ptr, int* minor_ptr, int* micro_ptr, int* proto_ptr);
typedef const char* (JACKBRIDGE_API *jackbridgesym_get_version_string)(void);
typedef jack_client_t* (JACKBRIDGE_API *jackbridgesym_client_open)(const char* client_name, uint32_t options, jack_status_t* status);
typedef bool (JACKBRIDGE_API *jackbridgesym_client_close)(jack_client_t* client);
typedef int (JACKBRIDGE_API *jackbridgesym_client_name_size)(void);
typedef char* (JACKBRIDGE_API *jackbridgesym_get_client_name)(jack_client_t* client);
typedef char* (JACKBRIDGE_API *jackbridgesym_get_uuid_for_client_name)(jack_client_t* client, const char* name);
typedef char* (JACKBRIDGE_API *jackbridgesym_get_client_name_by_uuid)(jack_client_t* client, const char* uuid);
typedef bool (JACKBRIDGE_API *jackbridgesym_activate)(jack_client_t* client);
typedef bool (JACKBRIDGE_API *jackbridgesym_deactivate)(jack_client_t* client);
typedef bool (JACKBRIDGE_API *jackbridgesym_is_realtime)(jack_client_t* client);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_thread_init_callback)(jack_client_t* client, JackThreadInitCallback thread_init_callback, void* arg);
typedef void (JACKBRIDGE_API *jackbridgesym_on_shutdown)(jack_client_t* client, JackShutdownCallback shutdown_callback, void* arg);
typedef void (JACKBRIDGE_API *jackbridgesym_on_info_shutdown)(jack_client_t* client, JackInfoShutdownCallback shutdown_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_process_callback)(jack_client_t* client, JackProcessCallback process_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_freewheel_callback)(jack_client_t* client, JackFreewheelCallback freewheel_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_buffer_size_callback)(jack_client_t* client, JackBufferSizeCallback bufsize_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_sample_rate_callback)(jack_client_t* client, JackSampleRateCallback srate_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_client_registration_callback)(jack_client_t* client, JackClientRegistrationCallback registration_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_port_registration_callback)(jack_client_t* client, JackPortRegistrationCallback registration_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_port_rename_callback)(jack_client_t* client, JackPortRenameCallback rename_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_port_connect_callback)(jack_client_t* client, JackPortConnectCallback connect_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_graph_order_callback)(jack_client_t* client, JackGraphOrderCallback graph_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_xrun_callback)(jack_client_t* client, JackXRunCallback xrun_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_latency_callback)(jack_client_t* client, JackLatencyCallback latency_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_freewheel)(jack_client_t* client, bool onoff);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_buffer_size)(jack_client_t* client, jack_nframes_t nframes);
typedef jack_nframes_t (JACKBRIDGE_API *jackbridgesym_get_sample_rate)(jack_client_t* client);
typedef jack_nframes_t (JACKBRIDGE_API *jackbridgesym_get_buffer_size)(jack_client_t* client);
typedef float (JACKBRIDGE_API *jackbridgesym_cpu_load)(jack_client_t* client);
typedef jack_port_t* (JACKBRIDGE_API *jackbridgesym_port_register)(jack_client_t* client, const char* port_name, const char* port_type, uint64_t flags, uint64_t buffer_size);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_unregister)(jack_client_t* client, jack_port_t* port);
typedef void* (JACKBRIDGE_API *jackbridgesym_port_get_buffer)(jack_port_t* port, jack_nframes_t nframes);
typedef const char* (JACKBRIDGE_API *jackbridgesym_port_name)(const jack_port_t* port);
typedef jack_uuid_t (JACKBRIDGE_API *jackbridgesym_port_uuid)(const jack_port_t* port);
typedef const char* (JACKBRIDGE_API *jackbridgesym_port_short_name)(const jack_port_t* port);
typedef int (JACKBRIDGE_API *jackbridgesym_port_flags)(const jack_port_t* port);
typedef const char* (JACKBRIDGE_API *jackbridgesym_port_type)(const jack_port_t* port);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_is_mine)(const jack_client_t* client, const jack_port_t* port);
typedef int (JACKBRIDGE_API *jackbridgesym_port_connected)(const jack_port_t* port);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_connected_to)(const jack_port_t* port, const char* port_name);
typedef const char** (JACKBRIDGE_API *jackbridgesym_port_get_connections)(const jack_port_t* port);
typedef const char** (JACKBRIDGE_API *jackbridgesym_port_get_all_connections)(const jack_client_t* client, const jack_port_t* port);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_set_name)(jack_port_t* port, const char* port_name);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_set_alias)(jack_port_t* port, const char* alias);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_unset_alias)(jack_port_t* port, const char* alias);
typedef int (JACKBRIDGE_API *jackbridgesym_port_get_aliases)(const jack_port_t* port, char* const aliases[2]);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_request_monitor)(jack_port_t* port, bool onoff);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_request_monitor_by_name)(jack_client_t* client, const char* port_name, bool onoff);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_ensure_monitor)(jack_port_t* port, bool onoff);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_monitoring_input)(jack_port_t* port);
typedef bool (JACKBRIDGE_API *jackbridgesym_connect)(jack_client_t* client, const char* source_port, const char* destination_port);
typedef bool (JACKBRIDGE_API *jackbridgesym_disconnect)(jack_client_t* client, const char* source_port, const char* destination_port);
typedef bool (JACKBRIDGE_API *jackbridgesym_port_disconnect)(jack_client_t* client, jack_port_t* port);
typedef int (JACKBRIDGE_API *jackbridgesym_port_name_size)(void);
typedef int (JACKBRIDGE_API *jackbridgesym_port_type_size)(void);
typedef uint32_t (JACKBRIDGE_API *jackbridgesym_port_type_get_buffer_size)(jack_client_t* client, const char* port_type);
typedef void (JACKBRIDGE_API *jackbridgesym_port_get_latency_range)(jack_port_t* port, uint32_t mode, jack_latency_range_t* range);
typedef void (JACKBRIDGE_API *jackbridgesym_port_set_latency_range)(jack_port_t* port, uint32_t mode, jack_latency_range_t* range);
typedef bool (JACKBRIDGE_API *jackbridgesym_recompute_total_latencies)(jack_client_t* client);
typedef const char** (JACKBRIDGE_API *jackbridgesym_get_ports)(jack_client_t* client, const char* port_name_pattern, const char* type_name_pattern, uint64_t flags);
typedef jack_port_t* (JACKBRIDGE_API *jackbridgesym_port_by_name)(jack_client_t* client, const char* port_name);
typedef jack_port_t* (JACKBRIDGE_API *jackbridgesym_port_by_id)(jack_client_t* client, jack_port_id_t port_id);
typedef void (JACKBRIDGE_API *jackbridgesym_free)(void* ptr);
typedef uint32_t (JACKBRIDGE_API *jackbridgesym_midi_get_event_count)(void* port_buffer);
typedef bool (JACKBRIDGE_API *jackbridgesym_midi_event_get)(jack_midi_event_t* event, void* port_buffer, uint32_t event_index);
typedef void (JACKBRIDGE_API *jackbridgesym_midi_clear_buffer)(void* port_buffer);
typedef bool (JACKBRIDGE_API *jackbridgesym_midi_event_write)(void* port_buffer, jack_nframes_t time, const jack_midi_data_t* data, uint32_t data_size);
typedef jack_midi_data_t* (JACKBRIDGE_API *jackbridgesym_midi_event_reserve)(void* port_buffer, jack_nframes_t time, uint32_t data_size);
typedef bool (JACKBRIDGE_API *jackbridgesym_release_timebase)(jack_client_t* client);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_sync_callback)(jack_client_t* client, JackSyncCallback sync_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_sync_timeout)(jack_client_t* client, jack_time_t timeout);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_timebase_callback)(jack_client_t* client, bool conditional, JackTimebaseCallback timebase_callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_transport_locate)(jack_client_t* client, jack_nframes_t frame);
typedef uint32_t (JACKBRIDGE_API *jackbridgesym_transport_query)(const jack_client_t* client, jack_position_t* pos);
typedef jack_nframes_t (JACKBRIDGE_API *jackbridgesym_get_current_transport_frame)(const jack_client_t* client);
typedef bool (JACKBRIDGE_API *jackbridgesym_transport_reposition)(jack_client_t* client, const jack_position_t* pos);
typedef void (JACKBRIDGE_API *jackbridgesym_transport_start)(jack_client_t* client);
typedef void (JACKBRIDGE_API *jackbridgesym_transport_stop)(jack_client_t* client);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_property)(jack_client_t* client, jack_uuid_t subject, const char* key, const char* value, const char* type);
typedef bool (JACKBRIDGE_API *jackbridgesym_get_property)(jack_uuid_t subject, const char* key, char** value, char** type);
typedef void (JACKBRIDGE_API *jackbridgesym_free_description)(jack_description_t* desc, bool free_description_itself);
typedef bool (JACKBRIDGE_API *jackbridgesym_get_properties)(jack_uuid_t subject, jack_description_t* desc);
typedef bool (JACKBRIDGE_API *jackbridgesym_get_all_properties)(jack_description_t** descs);
typedef bool (JACKBRIDGE_API *jackbridgesym_remove_property)(jack_client_t* client, jack_uuid_t subject, const char* key);
typedef int (JACKBRIDGE_API *jackbridgesym_remove_properties)(jack_client_t* client, jack_uuid_t subject);
typedef bool (JACKBRIDGE_API *jackbridgesym_remove_all_properties)(jack_client_t* client);
typedef bool (JACKBRIDGE_API *jackbridgesym_set_property_change_callback)(jack_client_t* client, JackPropertyChangeCallback callback, void* arg);
typedef bool (JACKBRIDGE_API *jackbridgesym_sem_init)(void* sem);
typedef void (JACKBRIDGE_API *jackbridgesym_sem_destroy)(void* sem);
typedef void (JACKBRIDGE_API *jackbridgesym_sem_post)(void* sem);
typedef bool (JACKBRIDGE_API *jackbridgesym_sem_timedwait)(void* sem, uint secs);
typedef bool (JACKBRIDGE_API *jackbridgesym_shm_is_valid)(const void* shm);
typedef void (JACKBRIDGE_API *jackbridgesym_shm_init)(void* shm);
typedef void (JACKBRIDGE_API *jackbridgesym_shm_attach)(void* shm, const char* name);
typedef void (JACKBRIDGE_API *jackbridgesym_shm_close)(void* shm);
typedef void* (JACKBRIDGE_API *jackbridgesym_shm_map)(void* shm, uint64_t size);

// -----------------------------------------------------------------------------

struct JackBridgeExportedFunctions {
struct _JackBridgeExportedFunctions {
ulong unique1;
jackbridgesym_get_version get_version_ptr;
jackbridgesym_get_version_string get_version_string_ptr;
@@ -175,6 +173,7 @@ struct JackBridgeExportedFunctions {
jackbridgesym_port_request_monitor_by_name port_request_monitor_by_name_ptr;
jackbridgesym_port_ensure_monitor port_ensure_monitor_ptr;
jackbridgesym_port_monitoring_input port_monitoring_input_ptr;
ulong unique2;
jackbridgesym_connect connect_ptr;
jackbridgesym_disconnect disconnect_ptr;
jackbridgesym_port_disconnect port_disconnect_ptr;
@@ -221,15 +220,15 @@ struct JackBridgeExportedFunctions {
jackbridgesym_shm_attach shm_attach_ptr;
jackbridgesym_shm_close shm_close_ptr;
jackbridgesym_shm_map shm_map_ptr;
ulong unique2;
ulong unique3;
};

typedef struct _JackBridgeExportedFunctions JackBridgeExportedFunctions;

// -----------------------------------------------------------------------------

extern "C" {
typedef const JackBridgeExportedFunctions* (JACKBRIDGE_API *jackbridge_exported_function_type)();

typedef const JackBridgeExportedFunctions* (__cdecl *jackbridge_exported_function_type)();
// -----------------------------------------------------------------------------

} // extern "C"

// -----------------------------------------------------------------------------

Loading…
Cancel
Save