Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

JackBridge3.cpp 9.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * JackBridge (Part 3, Export)
  3. * Copyright (C) 2013-2023 Filipe Coelho <falktx@falktx.com>
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for any purpose with
  6. * or without fee is hereby granted, provided that the above copyright notice and this
  7. * permission notice appear in all copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD
  10. * TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN
  11. * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  12. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
  13. * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  14. * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  15. */
  16. #include "JackBridgeExport.hpp"
  17. #include "CarlaUtils.hpp"
  18. // --------------------------------------------------------------------------------------------------------------------
  19. #if defined(CARLA_OS_WIN) && ! defined(__WINE__)
  20. # define JACKBRIDGE_EXPORT extern "C" __declspec (dllexport)
  21. #else
  22. # define JACKBRIDGE_EXPORT extern "C" __attribute__ ((visibility("default")))
  23. #endif
  24. // --------------------------------------------------------------------------------------------------------------------
  25. JACKBRIDGE_EXPORT
  26. const JackBridgeExportedFunctions* JACKBRIDGE_API jackbridge_get_exported_functions();
  27. JACKBRIDGE_EXPORT
  28. const JackBridgeExportedFunctions* JACKBRIDGE_API jackbridge_get_exported_functions()
  29. {
  30. static JackBridgeExportedFunctions funcs;
  31. carla_zeroStruct(funcs);
  32. funcs.init_ptr = jackbridge_init;
  33. funcs.get_version_ptr = jackbridge_get_version;
  34. funcs.get_version_string_ptr = jackbridge_get_version_string;
  35. funcs.client_open_ptr = jackbridge_client_open;
  36. funcs.client_close_ptr = jackbridge_client_close;
  37. funcs.client_name_size_ptr = jackbridge_client_name_size;
  38. funcs.get_client_name_ptr = jackbridge_get_client_name;
  39. funcs.client_get_uuid_ptr = jackbridge_client_get_uuid;
  40. funcs.get_uuid_for_client_name_ptr = jackbridge_get_uuid_for_client_name;
  41. funcs.get_client_name_by_uuid_ptr = jackbridge_get_client_name_by_uuid;
  42. funcs.uuid_parse_ptr = jackbridge_uuid_parse;
  43. funcs.uuid_unparse_ptr = jackbridge_uuid_unparse;
  44. funcs.activate_ptr = jackbridge_activate;
  45. funcs.deactivate_ptr = jackbridge_deactivate;
  46. funcs.is_realtime_ptr = jackbridge_is_realtime;
  47. funcs.set_thread_init_callback_ptr = jackbridge_set_thread_init_callback;
  48. funcs.on_shutdown_ptr = jackbridge_on_shutdown;
  49. funcs.on_info_shutdown_ptr = jackbridge_on_info_shutdown;
  50. funcs.set_process_callback_ptr = jackbridge_set_process_callback;
  51. funcs.set_freewheel_callback_ptr = jackbridge_set_freewheel_callback;
  52. funcs.set_buffer_size_callback_ptr = jackbridge_set_buffer_size_callback;
  53. funcs.set_sample_rate_callback_ptr = jackbridge_set_sample_rate_callback;
  54. funcs.set_client_registration_callback_ptr = jackbridge_set_client_registration_callback;
  55. funcs.set_port_registration_callback_ptr = jackbridge_set_port_registration_callback;
  56. funcs.set_port_rename_callback_ptr = jackbridge_set_port_rename_callback;
  57. funcs.set_port_connect_callback_ptr = jackbridge_set_port_connect_callback;
  58. funcs.set_graph_order_callback_ptr = jackbridge_set_graph_order_callback;
  59. funcs.set_xrun_callback_ptr = jackbridge_set_xrun_callback;
  60. funcs.set_latency_callback_ptr = jackbridge_set_latency_callback;
  61. funcs.set_freewheel_ptr = jackbridge_set_freewheel;
  62. funcs.set_buffer_size_ptr = jackbridge_set_buffer_size;
  63. funcs.get_sample_rate_ptr = jackbridge_get_sample_rate;
  64. funcs.get_buffer_size_ptr = jackbridge_get_buffer_size;
  65. funcs.cpu_load_ptr = jackbridge_cpu_load;
  66. funcs.port_register_ptr = jackbridge_port_register;
  67. funcs.port_unregister_ptr = jackbridge_port_unregister;
  68. funcs.port_get_buffer_ptr = jackbridge_port_get_buffer;
  69. funcs.port_name_ptr = jackbridge_port_name;
  70. funcs.port_uuid_ptr = jackbridge_port_uuid;
  71. funcs.port_short_name_ptr = jackbridge_port_short_name;
  72. funcs.port_flags_ptr = jackbridge_port_flags;
  73. funcs.port_type_ptr = jackbridge_port_type;
  74. funcs.port_is_mine_ptr = jackbridge_port_is_mine;
  75. funcs.port_connected_ptr = jackbridge_port_connected;
  76. funcs.port_connected_to_ptr = jackbridge_port_connected_to;
  77. funcs.port_get_connections_ptr = jackbridge_port_get_connections;
  78. funcs.port_get_all_connections_ptr = jackbridge_port_get_all_connections;
  79. funcs.port_rename_ptr = jackbridge_port_rename;
  80. funcs.port_set_alias_ptr = jackbridge_port_set_alias;
  81. funcs.port_unset_alias_ptr = jackbridge_port_unset_alias;
  82. funcs.port_get_aliases_ptr = jackbridge_port_get_aliases;
  83. funcs.port_request_monitor_ptr = jackbridge_port_request_monitor;
  84. funcs.port_request_monitor_by_name_ptr = jackbridge_port_request_monitor_by_name;
  85. funcs.port_ensure_monitor_ptr = jackbridge_port_ensure_monitor;
  86. funcs.port_monitoring_input_ptr = jackbridge_port_monitoring_input;
  87. funcs.connect_ptr = jackbridge_connect;
  88. funcs.disconnect_ptr = jackbridge_disconnect;
  89. funcs.port_disconnect_ptr = jackbridge_port_disconnect;
  90. funcs.port_name_size_ptr = jackbridge_port_name_size;
  91. funcs.port_type_size_ptr = jackbridge_port_type_size;
  92. funcs.port_type_get_buffer_size_ptr = jackbridge_port_type_get_buffer_size;
  93. funcs.port_get_latency_range_ptr = jackbridge_port_get_latency_range;
  94. funcs.port_set_latency_range_ptr = jackbridge_port_set_latency_range;
  95. funcs.recompute_total_latencies_ptr = jackbridge_recompute_total_latencies;
  96. funcs.get_ports_ptr = jackbridge_get_ports;
  97. funcs.port_by_name_ptr = jackbridge_port_by_name;
  98. funcs.port_by_id_ptr = jackbridge_port_by_id;
  99. funcs.free_ptr = jackbridge_free;
  100. funcs.midi_get_event_count_ptr = jackbridge_midi_get_event_count;
  101. funcs.midi_event_get_ptr = jackbridge_midi_event_get;
  102. funcs.midi_clear_buffer_ptr = jackbridge_midi_clear_buffer;
  103. funcs.midi_event_write_ptr = jackbridge_midi_event_write;
  104. funcs.midi_event_reserve_ptr = jackbridge_midi_event_reserve;
  105. funcs.release_timebase_ptr = jackbridge_release_timebase;
  106. funcs.set_sync_callback_ptr = jackbridge_set_sync_callback;
  107. funcs.set_sync_timeout_ptr = jackbridge_set_sync_timeout;
  108. funcs.set_timebase_callback_ptr = jackbridge_set_timebase_callback;
  109. funcs.transport_locate_ptr = jackbridge_transport_locate;
  110. funcs.transport_query_ptr = jackbridge_transport_query;
  111. funcs.get_current_transport_frame_ptr = jackbridge_get_current_transport_frame;
  112. funcs.transport_reposition_ptr = jackbridge_transport_reposition;
  113. funcs.transport_start_ptr = jackbridge_transport_start;
  114. funcs.transport_stop_ptr = jackbridge_transport_stop;
  115. funcs.set_property_ptr = jackbridge_set_property;
  116. funcs.get_property_ptr = jackbridge_get_property;
  117. funcs.free_description_ptr = jackbridge_free_description;
  118. funcs.get_properties_ptr = jackbridge_get_properties;
  119. funcs.get_all_properties_ptr = jackbridge_get_all_properties;
  120. funcs.remove_property_ptr = jackbridge_remove_property;
  121. funcs.remove_properties_ptr = jackbridge_remove_properties;
  122. funcs.remove_all_properties_ptr = jackbridge_remove_all_properties;
  123. funcs.set_property_change_callback_ptr = jackbridge_set_property_change_callback;
  124. funcs.sem_init_ptr = jackbridge_sem_init;
  125. funcs.sem_destroy_ptr = jackbridge_sem_destroy;
  126. funcs.sem_connect_ptr = jackbridge_sem_connect;
  127. funcs.sem_post_ptr = jackbridge_sem_post;
  128. funcs.sem_timedwait_ptr = jackbridge_sem_timedwait;
  129. funcs.shm_is_valid_ptr = jackbridge_shm_is_valid;
  130. funcs.shm_init_ptr = jackbridge_shm_init;
  131. funcs.shm_attach_ptr = jackbridge_shm_attach;
  132. funcs.shm_close_ptr = jackbridge_shm_close;
  133. funcs.shm_map_ptr = jackbridge_shm_map;
  134. funcs.shm_unmap_ptr = jackbridge_shm_unmap;
  135. funcs.discovery_pipe_create_ptr = jackbridge_discovery_pipe_create;
  136. funcs.discovery_pipe_message_ptr = jackbridge_discovery_pipe_message;
  137. funcs.discovery_pipe_destroy_ptr = jackbridge_discovery_pipe_destroy;
  138. funcs.parent_deathsig_ptr = jackbridge_parent_deathsig;
  139. funcs.unique1 = funcs.unique2 = funcs.unique3 = 0xdeadf00d;
  140. return &funcs;
  141. }
  142. // --------------------------------------------------------------------------------------------------------------------