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 8.9KB

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