AudioWeakJack.def 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /* macro-absraction of the JACK API
  2. *
  3. * see weak_libjack.c for details, in general arguments are:
  4. *
  5. * [required], [return type], [name], [arguments], [code or return value]
  6. *
  7. * This file is included multiple times with different macro definitions
  8. * do not add header guards.
  9. * see https://en.wikibooks.org/wiki/C_Programming/Preprocessor#X-Macros
  10. */
  11. #ifdef USE_WEAK_JACK
  12. /* <jack/jack.h> */
  13. JCFUN(1, int, client_close, 0)
  14. JCFUN(1, char*, get_client_name, NULL)
  15. JVFUN(0, on_shutdown, (jack_client_t *c, JackShutdownCallback s, void *a), (c,s,a),)
  16. JVFUN(0, on_info_shutdown, (jack_client_t *c, JackInfoShutdownCallback s, void *a), (c,s,a),)
  17. JPFUN(1, int, set_process_callback, (jack_client_t *c, JackProcessCallback p, void *a), (c,p,a), -1)
  18. JPFUN(1, int, set_freewheel_callback, (jack_client_t *c, JackFreewheelCallback p, void *a), (c,p,a), -1)
  19. JPFUN(1, int, set_buffer_size_callback, (jack_client_t *c, JackBufferSizeCallback p, void *a), (c,p,a), -1)
  20. JPFUN(1, int, set_sample_rate_callback, (jack_client_t *c, JackSampleRateCallback p, void *a), (c,p,a), -1)
  21. JPFUN(1, int, set_port_registration_callback, (jack_client_t *c, JackPortRegistrationCallback p, void *a), (c,p,a), -1)
  22. JPFUN(1, int, set_port_connect_callback, (jack_client_t *c, JackPortConnectCallback p, void *a), (c,p,a), -1)
  23. JPFUN(1, int, set_graph_order_callback, (jack_client_t *c, JackGraphOrderCallback g, void *a), (c,g,a), -1)
  24. JPFUN(1, int, set_xrun_callback, (jack_client_t *c, JackXRunCallback g, void *a), (c,g,a), -1)
  25. JPFUN(1, int, set_latency_callback, (jack_client_t *c, JackLatencyCallback g, void *a), (c,g,a), -1)
  26. JVFUN(1, set_error_function, (void (*f)(const char *)), (f),)
  27. JVFUN(1, set_info_function, (void (*f)(const char *)), (f),)
  28. JCFUN(1, int, activate, -1)
  29. JCFUN(1, int, deactivate, -1)
  30. JPFUN(1, int, client_name_size, (), (), 32)
  31. JCFUN(1, jack_nframes_t, get_sample_rate, 0)
  32. JCFUN(1, jack_nframes_t, get_buffer_size, 0)
  33. JPFUN(1, jack_nframes_t, frames_since_cycle_start, (const jack_client_t *c), (c), 0)
  34. JPFUN(1, jack_nframes_t, frame_time, (const jack_client_t *c), (c), 0)
  35. JPFUN(1, jack_nframes_t, last_frame_time, (const jack_client_t *c), (c), 0)
  36. JPFUN(1, jack_time_t, get_time, (void), (), 0)
  37. JCFUN(1, float, cpu_load, 0)
  38. JCFUN(1, int, is_realtime, 0)
  39. JPFUN(1, int, set_freewheel, (jack_client_t *c, int o), (c,o), 0)
  40. JPFUN(1, int, set_buffer_size, (jack_client_t *c, jack_nframes_t b), (c,b), 0)
  41. JCFUN(0, int, recompute_total_latencies, 0)
  42. JPFUN(0, jack_nframes_t, port_get_total_latency, (jack_client_t *c, jack_port_t *p), (c,p), 0)
  43. JVFUN(0, port_get_latency_range, (jack_port_t *p, jack_latency_callback_mode_t m, jack_latency_range_t *r), (p,m,r), if (r) {r->min = r->max = 0;})
  44. JVFUN(0, port_set_latency_range, (jack_port_t *p, jack_latency_callback_mode_t m, jack_latency_range_t *r), (p,m,r),)
  45. JPFUN(1, void*, port_get_buffer, (jack_port_t *p, jack_nframes_t n), (p,n), NULL)
  46. JPFUN(1, int, port_request_monitor, (jack_port_t *p, int o), (p,o), 0)
  47. JPFUN(1, int, port_ensure_monitor, (jack_port_t *p, int o), (p,o), 0)
  48. JPFUN(1, int, port_monitoring_input, (jack_port_t *p), (p), 0)
  49. JPFUN(1, const char*, port_name, (const jack_port_t *p), (p), NULL)
  50. JPFUN(1, const char*, port_short_name, (const jack_port_t *p), (p), NULL)
  51. JPFUN(1, int, port_flags, (const jack_port_t *p), (p), 0)
  52. JPFUN(1, const char**, get_ports,(jack_client_t *c, const char *p, const char *t, unsigned long f), (c,p,t,f), NULL)
  53. JPFUN(1, int, port_name_size, (void), (), 0)
  54. JPFUN(1, int, port_type_size, (void), (), 0)
  55. JPFUN(1, size_t, port_type_get_buffer_size, (jack_client_t *c, const char *t), (c,t), 0)
  56. JPFUN(1, jack_port_t*, port_by_name, (jack_client_t *c, const char *n), (c,n), NULL)
  57. JPFUN(1, jack_port_t*, port_by_id, (jack_client_t *c, jack_port_id_t i), (c,i), NULL)
  58. JPFUN(1, jack_port_t*, port_register, (jack_client_t *c, const char *n, const char *t, unsigned long f, unsigned long b), (c,n,t,f,b), NULL)
  59. JPFUN(1, int, port_unregister, (jack_client_t *c, jack_port_t *p), (c,p), 0)
  60. JPFUN(1, const char *, port_type, (const jack_port_t *p), (p), 0)
  61. JPFUN(1, const char **, port_get_connections, (const jack_port_t *p), (p), 0)
  62. JPFUN(1, const char **, port_get_all_connections, (const jack_client_t *c, const jack_port_t *p), (c,p), 0)
  63. JPFUN(1, int, port_set_name, (jack_port_t *p, const char *n), (p,n), -1)
  64. #pragma GCC diagnostic push
  65. #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
  66. JXFUN(0, int, port_rename, (jack_client_t *c, jack_port_t *p, const char *n), (c,p,n), return jack_port_set_name (p,n);)
  67. #pragma GCC diagnostic pop
  68. JPFUN(1, int, port_get_aliases, (const jack_port_t *port, char* const aliases[2]), (port,aliases), 0)
  69. JPFUN(1, int, port_disconnect, (jack_client_t *c, jack_port_t *p), (c,p), 0)
  70. JPFUN(1, int, connect, (jack_client_t *c, const char *s, const char *d), (c,s,d), -1)
  71. JPFUN(1, int, disconnect, (jack_client_t *c, const char *s, const char *d), (c,s,d), -1)
  72. JVFUN(0, free, (void *p), (p), free(p);)
  73. JCFUN(1, jack_nframes_t, cycle_wait, 0)
  74. JVFUN(1, cycle_signal, (jack_client_t *c, int s), (c,s),)
  75. JPFUN(1, int, set_process_thread, (jack_client_t *c, JackThreadCallback p, void *a), (c,p,a), -1)
  76. JPFUN(1, int, set_thread_init_callback, (jack_client_t *c, JackThreadInitCallback p, void *a), (c,p,a), -1)
  77. JPFUN(1, int, transport_locate, (jack_client_t *c, jack_nframes_t f), (c,f), 0)
  78. JVFUN(1, transport_start, (jack_client_t *c), (c),)
  79. JVFUN(1, transport_stop, (jack_client_t *c), (c),)
  80. JPFUN(1, jack_nframes_t, get_current_transport_frame, (const jack_client_t *c), (c), 0)
  81. JXFUN(1, jack_transport_state_t, transport_query, (const jack_client_t *c, jack_position_t *p), (c,p), memset(p, 0, sizeof(jack_position_t)); return JackTransportStopped;)
  82. JPFUN(1, int, set_sync_callback, (jack_client_t *c, JackSyncCallback p, void *a), (c,p,a), -1)
  83. JPFUN(1, int, set_timebase_callback, (jack_client_t *c, int l, JackTimebaseCallback p, void *a), (c,l,p,a), -1)
  84. JCFUN(1, int, release_timebase, 0)
  85. /* <jack/midiport.h> */
  86. JPFUN(1, uint32_t, midi_get_event_count, (void* p), (p), 0)
  87. JPFUN(1, int, midi_event_get, (jack_midi_event_t *e, void *p, uint32_t i), (e,p,i), -1)
  88. JPFUN(1, int, midi_event_write, (void *b, jack_nframes_t t, const jack_midi_data_t *d, size_t s), (b,t,d,s), -1)
  89. JVFUN(1, midi_clear_buffer, (void *b), (b),)
  90. /* <jack/session.h> */
  91. JPFUN(0, int, set_session_callback, (jack_client_t *c, JackSessionCallback s, void *a), (c,s,a), -1)
  92. JPFUN(0, int, session_reply, (jack_client_t *c, jack_session_event_t *e), (c,e), -1)
  93. JVFUN(0, session_event_free, (jack_session_event_t *e), (e), )
  94. /* <jack/ringbuffer.h> */
  95. JPFUN(1, jack_ringbuffer_t *, ringbuffer_create, (size_t s), (s), NULL)
  96. JVFUN(1, ringbuffer_free, (jack_ringbuffer_t *rb), (rb), )
  97. JVFUN(1, ringbuffer_reset, (jack_ringbuffer_t *rb), (rb), )
  98. JVFUN(1, ringbuffer_read_advance, (jack_ringbuffer_t *rb, size_t c), (rb,c), )
  99. JVFUN(1, ringbuffer_write_advance, (jack_ringbuffer_t *rb, size_t c), (rb,c), )
  100. JPFUN(1, size_t, ringbuffer_read_space, (const jack_ringbuffer_t *rb), (rb), 0)
  101. JPFUN(1, size_t, ringbuffer_write_space, (const jack_ringbuffer_t *rb), (rb), 0)
  102. JPFUN(1, size_t, ringbuffer_read, (jack_ringbuffer_t *rb, char *d, size_t c), (rb,d,c), 0)
  103. JPFUN(1, size_t, ringbuffer_write, (jack_ringbuffer_t *rb, const char *s, size_t c), (rb,s,c), 0)
  104. JPFUN(0, int, ringbuffer_mlock, (jack_ringbuffer_t *rb), (rb), 0)
  105. JVFUN(0, ringbuffer_get_read_vector, (const jack_ringbuffer_t *rb, jack_ringbuffer_data_t *v), (rb,v), if (v) {v->buf=NULL; v->len=0;} )
  106. JVFUN(0, ringbuffer_get_write_vector, (const jack_ringbuffer_t *rb, jack_ringbuffer_data_t *v), (rb,v), if (v) {v->buf=NULL; v->len=0;} )
  107. JPFUN(0, size_t, ringbuffer_peek, (jack_ringbuffer_t *rb, char *d, size_t c), (rb,d,c), 0)
  108. /* <jack/thread.h> */
  109. JCFUN(0, int, client_real_time_priority, 0)
  110. JCFUN(0, int, client_max_real_time_priority, 0)
  111. JPFUN(0, int, acquire_real_time_scheduling, (jack_native_thread_t t, int p), (t,p), 0)
  112. JPFUN(0, int, drop_real_time_scheduling, (jack_native_thread_t t), (t), 0)
  113. JPFUN(0, int, client_stop_thread, (jack_client_t* c, jack_native_thread_t t), (c,t), 0)
  114. JPFUN(0, int, client_kill_thread, (jack_client_t* c, jack_native_thread_t t), (c,t), 0)
  115. #ifndef _WIN32
  116. JVFUN(0, set_thread_creator, (jack_thread_creator_t c), (c),)
  117. #endif
  118. JPFUN(1, int, client_create_thread, \
  119. (jack_client_t* c, jack_native_thread_t *t, int p, int r, void *(*f)(void*), void *a), (c,t,p,r,f,a), 0)
  120. #ifndef NO_JACK_METADATA
  121. /* <jack/uuid.h> - TODO*/
  122. /* <jack/jack.h> */
  123. JPFUN(0, char *, get_uuid_for_client_name, (jack_client_t* c, const char* n), (c,n), NULL)
  124. JPFUN(0, char *, get_client_name_by_uuid, (jack_client_t* c, const char* u), (c,u), NULL)
  125. JPFUN(0, jack_uuid_t, port_uuid, (const jack_port_t *p), (p), 0)
  126. /* <jack/metadata.h> */
  127. JPFUN(0, int, set_property, (jack_client_t* c, jack_uuid_t s, const char* k, const char* v, const char* t), (c,s,k,v,t), -1)
  128. JXFUN(0, int, get_property, (jack_uuid_t s, const char* k, char** v, char** t), (s,k,v,t), if (v) *v=NULL; if (t) *t=NULL; return -1;)
  129. JVFUN(0, free_description, (jack_description_t* d, int f), (d,f),)
  130. JXFUN(0, int, get_properties, (jack_uuid_t s, jack_description_t* d), (s,d), if (d) {d->properties = NULL; d->property_cnt = 0;} return -1;)
  131. JXFUN(0, int, get_all_properties, (jack_description_t** d), (d), if (d) *d=NULL; return -1;)
  132. JPFUN(0, int, remove_property, (jack_client_t* c, jack_uuid_t s, const char* k), (c,s,k), -1)
  133. JPFUN(0, int, remove_properties, (jack_client_t* c, jack_uuid_t s), (c,s), -1)
  134. JPFUN(0, int, remove_all_properties, (jack_client_t* c), (c), -1)
  135. JPFUN(0, int, set_property_change_callback, (jack_client_t *c, JackPropertyChangeCallback s, void *a), (c,s,a), -1)
  136. #endif
  137. /* <jack/statistics.h> */
  138. JCFUN(1, float, get_max_delayed_usecs, 0.0)
  139. JCFUN(1, float, get_xrun_delayed_usecs, 0.0)
  140. JVFUN(0, reset_max_delayed_usecs, (jack_client_t *c), (c),)
  141. #endif // end USE_WEAK_JACK