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.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. /*
  2. * JackBridge (Part 3, Export)
  3. * Copyright (C) 2013-2015 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.get_uuid_for_client_name_ptr = jackbridge_get_uuid_for_client_name;
  40. funcs.get_client_name_by_uuid_ptr = jackbridge_get_client_name_by_uuid;
  41. funcs.activate_ptr = jackbridge_activate;
  42. funcs.deactivate_ptr = jackbridge_deactivate;
  43. funcs.is_realtime_ptr = jackbridge_is_realtime;
  44. funcs.set_thread_init_callback_ptr = jackbridge_set_thread_init_callback;
  45. funcs.on_shutdown_ptr = jackbridge_on_shutdown;
  46. funcs.on_info_shutdown_ptr = jackbridge_on_info_shutdown;
  47. funcs.set_process_callback_ptr = jackbridge_set_process_callback;
  48. funcs.set_freewheel_callback_ptr = jackbridge_set_freewheel_callback;
  49. funcs.set_buffer_size_callback_ptr = jackbridge_set_buffer_size_callback;
  50. funcs.set_sample_rate_callback_ptr = jackbridge_set_sample_rate_callback;
  51. funcs.set_client_registration_callback_ptr = jackbridge_set_client_registration_callback;
  52. funcs.set_port_registration_callback_ptr = jackbridge_set_port_registration_callback;
  53. funcs.set_port_rename_callback_ptr = jackbridge_set_port_rename_callback;
  54. funcs.set_port_connect_callback_ptr = jackbridge_set_port_connect_callback;
  55. funcs.set_graph_order_callback_ptr = jackbridge_set_graph_order_callback;
  56. funcs.set_xrun_callback_ptr = jackbridge_set_xrun_callback;
  57. funcs.set_latency_callback_ptr = jackbridge_set_latency_callback;
  58. funcs.set_freewheel_ptr = jackbridge_set_freewheel;
  59. funcs.set_buffer_size_ptr = jackbridge_set_buffer_size;
  60. funcs.get_sample_rate_ptr = jackbridge_get_sample_rate;
  61. funcs.get_buffer_size_ptr = jackbridge_get_buffer_size;
  62. funcs.cpu_load_ptr = jackbridge_cpu_load;
  63. funcs.port_register_ptr = jackbridge_port_register;
  64. funcs.port_unregister_ptr = jackbridge_port_unregister;
  65. funcs.port_get_buffer_ptr = jackbridge_port_get_buffer;
  66. funcs.port_name_ptr = jackbridge_port_name;
  67. funcs.port_uuid_ptr = jackbridge_port_uuid;
  68. funcs.port_short_name_ptr = jackbridge_port_short_name;
  69. funcs.port_flags_ptr = jackbridge_port_flags;
  70. funcs.port_type_ptr = jackbridge_port_type;
  71. funcs.port_is_mine_ptr = jackbridge_port_is_mine;
  72. funcs.port_connected_ptr = jackbridge_port_connected;
  73. funcs.port_connected_to_ptr = jackbridge_port_connected_to;
  74. funcs.port_get_connections_ptr = jackbridge_port_get_connections;
  75. funcs.port_get_all_connections_ptr = jackbridge_port_get_all_connections;
  76. funcs.port_rename_ptr = jackbridge_port_rename;
  77. funcs.port_set_alias_ptr = jackbridge_port_set_alias;
  78. funcs.port_unset_alias_ptr = jackbridge_port_unset_alias;
  79. funcs.port_get_aliases_ptr = jackbridge_port_get_aliases;
  80. funcs.port_request_monitor_ptr = jackbridge_port_request_monitor;
  81. funcs.port_request_monitor_by_name_ptr = jackbridge_port_request_monitor_by_name;
  82. funcs.port_ensure_monitor_ptr = jackbridge_port_ensure_monitor;
  83. funcs.port_monitoring_input_ptr = jackbridge_port_monitoring_input;
  84. funcs.connect_ptr = jackbridge_connect;
  85. funcs.disconnect_ptr = jackbridge_disconnect;
  86. funcs.port_disconnect_ptr = jackbridge_port_disconnect;
  87. funcs.port_name_size_ptr = jackbridge_port_name_size;
  88. funcs.port_type_size_ptr = jackbridge_port_type_size;
  89. funcs.port_type_get_buffer_size_ptr = jackbridge_port_type_get_buffer_size;
  90. funcs.port_get_latency_range_ptr = jackbridge_port_get_latency_range;
  91. funcs.port_set_latency_range_ptr = jackbridge_port_set_latency_range;
  92. funcs.recompute_total_latencies_ptr = jackbridge_recompute_total_latencies;
  93. funcs.get_ports_ptr = jackbridge_get_ports;
  94. funcs.port_by_name_ptr = jackbridge_port_by_name;
  95. funcs.port_by_id_ptr = jackbridge_port_by_id;
  96. funcs.free_ptr = jackbridge_free;
  97. funcs.midi_get_event_count_ptr = jackbridge_midi_get_event_count;
  98. funcs.midi_event_get_ptr = jackbridge_midi_event_get;
  99. funcs.midi_clear_buffer_ptr = jackbridge_midi_clear_buffer;
  100. funcs.midi_event_write_ptr = jackbridge_midi_event_write;
  101. funcs.midi_event_reserve_ptr = jackbridge_midi_event_reserve;
  102. funcs.release_timebase_ptr = jackbridge_release_timebase;
  103. funcs.set_sync_callback_ptr = jackbridge_set_sync_callback;
  104. funcs.set_sync_timeout_ptr = jackbridge_set_sync_timeout;
  105. funcs.set_timebase_callback_ptr = jackbridge_set_timebase_callback;
  106. funcs.transport_locate_ptr = jackbridge_transport_locate;
  107. funcs.transport_query_ptr = jackbridge_transport_query;
  108. funcs.get_current_transport_frame_ptr = jackbridge_get_current_transport_frame;
  109. funcs.transport_reposition_ptr = jackbridge_transport_reposition;
  110. funcs.transport_start_ptr = jackbridge_transport_start;
  111. funcs.transport_stop_ptr = jackbridge_transport_stop;
  112. funcs.set_property_ptr = jackbridge_set_property;
  113. funcs.get_property_ptr = jackbridge_get_property;
  114. funcs.free_description_ptr = jackbridge_free_description;
  115. funcs.get_properties_ptr = jackbridge_get_properties;
  116. funcs.get_all_properties_ptr = jackbridge_get_all_properties;
  117. funcs.remove_property_ptr = jackbridge_remove_property;
  118. funcs.remove_properties_ptr = jackbridge_remove_properties;
  119. funcs.remove_all_properties_ptr = jackbridge_remove_all_properties;
  120. funcs.set_property_change_callback_ptr = jackbridge_set_property_change_callback;
  121. funcs.sem_init_ptr = jackbridge_sem_init;
  122. funcs.sem_destroy_ptr = jackbridge_sem_destroy;
  123. funcs.sem_post_ptr = jackbridge_sem_post;
  124. funcs.sem_timedwait_ptr = jackbridge_sem_timedwait;
  125. funcs.shm_is_valid_ptr = jackbridge_shm_is_valid;
  126. funcs.shm_init_ptr = jackbridge_shm_init;
  127. funcs.shm_attach_ptr = jackbridge_shm_attach;
  128. funcs.shm_close_ptr = jackbridge_shm_close;
  129. funcs.shm_map_ptr = jackbridge_shm_map;
  130. funcs.unique1 = funcs.unique2 = funcs.unique3 = 0xdeadf00d;
  131. return &funcs;
  132. }
  133. // -----------------------------------------------------------------------------