types.inc 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820
  1. (*
  2. Copyright (C) 2001 Paul Davis
  3. Copyright (C) 2004 Jack O'Quin
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  15. *)
  16. {$ifndef __jack_types_h__}
  17. {$define __jack_types_h__}
  18. //#include <jack/systemdeps.h>
  19. {$I systemdeps.inc}
  20. type
  21. PPjack_uuid_t = ^Pjack_uuid_t;
  22. Pjack_uuid_t = ^jack_uuid_t;
  23. jack_uuid_t = uint64_t;
  24. PPjack_shmsize_t = ^Pjack_shmsize_t;
  25. Pjack_shmsize_t = ^jack_shmsize_t;
  26. jack_shmsize_t = int32_t;
  27. (**
  28. * Type used to represent sample frame counts.
  29. *)
  30. PPjack_nframes_t = ^Pjack_nframes_t;
  31. Pjack_nframes_t = ^jack_nframes_t;
  32. jack_nframes_t = uint32_t;
  33. (**
  34. * Maximum value that can be stored in jack_nframes_t
  35. *)
  36. const
  37. JACK_MAX_FRAMES = 4294967295; { This should be UINT32_MAX, but C++ has a problem with that. }
  38. (**
  39. * Type used to represent the value of free running
  40. * monotonic clock with units of microseconds.
  41. *)
  42. type
  43. PPjack_time_t = ^Pjack_time_t;
  44. Pjack_time_t = ^jack_time_t;
  45. jack_time_t = uint64_t;
  46. (**
  47. * Maximum size of @a load_init string passed to an internal client
  48. * jack_initialize() function via jack_internal_client_load().
  49. *)
  50. const
  51. JACK_LOAD_INIT_LIMIT = 1024;
  52. (**
  53. * jack_intclient_t is an opaque type representing a loaded internal
  54. * client. You may only access it using the API provided in @ref
  55. * intclient.h "<jack/intclient.h>".
  56. *)
  57. type
  58. PPjack_intclient_t = ^Pjack_intclient_t;
  59. Pjack_intclient_t = ^jack_intclient_t;
  60. jack_intclient_t = uint64_t;
  61. (**
  62. * jack_port_t is an opaque type. You may only access it using the
  63. * API provided.
  64. *)
  65. //typedef struct _jack_port jack_port_t;
  66. PPjack_port_t = ^Pjack_port_t;
  67. Pjack_port_t = ^jack_port_t;
  68. jack_port_t = record end;
  69. (**
  70. * jack_client_t is an opaque type. You may only access it using the
  71. * API provided.
  72. *)
  73. //typedef struct _jack_client jack_client_t;
  74. PPjack_client_t = ^Pjack_client_t;
  75. Pjack_client_t = ^jack_client_t;
  76. jack_client_t = record end;
  77. (**
  78. * Ports have unique ids. A port registration callback is the only
  79. * place you ever need to know their value.
  80. *)
  81. PPjack_port_id_t = ^jack_port_id_t;
  82. Pjack_port_id_t = ^jack_port_id_t;
  83. jack_port_id_t = uint32_t;
  84. PPjack_port_type_id_t = ^Pjack_port_type_id_t;
  85. Pjack_port_type_id_t = ^jack_port_type_id_t;
  86. jack_port_type_id_t = uint32_t;
  87. (**
  88. * @ref jack_options_t bits
  89. *)
  90. JackOptions = (
  91. (**
  92. * Null value to use when no option bits are needed.
  93. *)
  94. JackNullOption = $00,
  95. (**
  96. * Do not automatically start the JACK server when it is not
  97. * already running. This option is always selected if
  98. * \$JACK_NO_START_SERVER is defined in the calling process
  99. * environment.
  100. *)
  101. JackNoStartServer = $01,
  102. (**
  103. * Use the exact client name requested. Otherwise, JACK
  104. * automatically generates a unique one, if needed.
  105. *)
  106. JackUseExactName = $02,
  107. (**
  108. * Open with optional <em>(char * ) server_name</em> parameter.
  109. *)
  110. JackServerName = $04,
  111. (**
  112. * Load internal client from optional <em>(char * )
  113. * load_name</em>. Otherwise use the @a client_name.
  114. *)
  115. JackLoadName = $08,
  116. (**
  117. * Pass optional <em>(char * ) load_init</em> string to the
  118. * jack_initialize() entry point of an internal client.
  119. *)
  120. JackLoadInit = $10,
  121. (**
  122. * pass a SessionID Token this allows the sessionmanager to identify the client again.
  123. *)
  124. JackSessionID = $20
  125. );
  126. (** Valid options for opening an external client. *)
  127. const
  128. JackOpenOptions = JackOptions(Ord(JackSessionID) or Ord(JackServerName) or Ord(JackNoStartServer) or Ord(JackUseExactName));
  129. (** Valid options for loading an internal client. *)
  130. JackLoadOptions = JackOptions(Ord(JackLoadInit) or Ord(JackLoadName) or Ord(JackUseExactName));
  131. (**
  132. * Options for several JACK operations, formed by OR-ing together the
  133. * relevant @ref JackOptions bits.
  134. *)
  135. type
  136. PPjack_options_t = ^Pjack_options_t;
  137. Pjack_options_t = ^jack_options_t;
  138. jack_options_t = JackOptions;
  139. (**
  140. * @ref jack_status_t bits
  141. *)
  142. JackStatus = (
  143. (**
  144. * Overall operation failed.
  145. *)
  146. JackFailure = $01,
  147. (**
  148. * The operation contained an invalid or unsupported option.
  149. *)
  150. JackInvalidOption = $02,
  151. (**
  152. * The desired client name was not unique. With the @ref
  153. * JackUseExactName option this situation is fatal. Otherwise,
  154. * the name was modified by appending a dash and a two-digit
  155. * number in the range "-01" to "-99". The
  156. * jack_get_client_name() function will return the exact string
  157. * that was used. If the specified @a client_name plus these
  158. * extra characters would be too long, the open fails instead.
  159. *)
  160. JackNameNotUnique = $04,
  161. (**
  162. * The JACK server was started as a result of this operation.
  163. * Otherwise, it was running already. In either case the caller
  164. * is now connected to jackd, so there is no race condition.
  165. * When the server shuts down, the client will find out.
  166. *)
  167. JackServerStarted = $08,
  168. (**
  169. * Unable to connect to the JACK server.
  170. *)
  171. JackServerFailed = $10,
  172. (**
  173. * Communication error with the JACK server.
  174. *)
  175. JackServerError = $20,
  176. (**
  177. * Requested client does not exist.
  178. *)
  179. JackNoSuchClient = $40,
  180. (**
  181. * Unable to load internal client
  182. *)
  183. JackLoadFailure = $80,
  184. (**
  185. * Unable to initialize client
  186. *)
  187. JackInitFailure = $100,
  188. (**
  189. * Unable to access shared memory
  190. *)
  191. JackShmFailure = $200,
  192. (**
  193. * Client's protocol version does not match
  194. *)
  195. JackVersionError = $400,
  196. (**
  197. * Backend error
  198. *)
  199. JackBackendError = $800,
  200. (**
  201. * Client zombified failure
  202. *)
  203. JackClientZombie = $1000
  204. );
  205. (**
  206. * Status word returned from several JACK operations, formed by
  207. * OR-ing together the relevant @ref JackStatus bits.
  208. *)
  209. PPjack_status_t = ^Pjack_status_t;
  210. Pjack_status_t = ^jack_status_t;
  211. jack_status_t = JackStatus;
  212. (**
  213. * @ref jack_latency_callback_mode_t
  214. *)
  215. JackLatencyCallbackMode = (
  216. (**
  217. * Latency Callback for Capture Latency.
  218. * Input Ports have their latency value setup.
  219. * In the Callback the client needs to set the latency of the output ports
  220. *)
  221. JackCaptureLatency,
  222. (**
  223. * Latency Callback for Playback Latency.
  224. * Output Ports have their latency value setup.
  225. * In the Callback the client needs to set the latency of the input ports
  226. *)
  227. JackPlaybackLatency
  228. );
  229. (**
  230. * Type of Latency Callback (Capture or Playback)
  231. *)
  232. PPjack_latency_callback_mode_t = ^Pjack_latency_callback_mode_t;
  233. Pjack_latency_callback_mode_t = ^jack_latency_callback_mode_t;
  234. jack_latency_callback_mode_t = JackLatencyCallbackMode;
  235. (**
  236. * Prototype for the client supplied function that is called
  237. * by the engine when port latencies need to be recalculated
  238. *
  239. * @param mode playback or capture latency
  240. * @param arg pointer to a client supplied data
  241. *
  242. * @return zero on success, non-zero on error
  243. *)
  244. //typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg);
  245. TJackLatencyCallback = procedure(mode: jack_latency_callback_mode_t; arg: Pointer); cdecl;
  246. (**
  247. * the new latency API operates on Ranges.
  248. *)
  249. //PRE_PACKED_STRUCTURE
  250. _jack_latency_range = packed record
  251. (**
  252. * minimum latency
  253. *)
  254. min: jack_nframes_t;
  255. (**
  256. * maximum latency
  257. *)
  258. max: jack_nframes_t;
  259. end;
  260. //} POST_PACKED_STRUCTURE;
  261. //typedef struct _jack_latency_range jack_latency_range_t;
  262. PPjack_latency_range_t = ^Pjack_latency_range_t;
  263. Pjack_latency_range_t = ^jack_latency_range_t;
  264. jack_latency_range_t = _jack_latency_range;
  265. (**
  266. * Prototype for the client supplied function that is called
  267. * by the engine anytime there is work to be done.
  268. *
  269. * @pre nframes == jack_get_buffer_size()
  270. * @pre nframes == pow(2,x)
  271. *
  272. * @param nframes number of frames to process
  273. * @param arg pointer to a client supplied structure
  274. *
  275. * @return zero on success, non-zero on error
  276. *)
  277. //typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
  278. TJackProcessCallback = function(nframes: jack_nframes_t; arg: Pointer): cint; cdecl;
  279. (**
  280. * Prototype for the client thread routine called
  281. * by the engine when the client is inserted in the graph.
  282. *
  283. * @param arg pointer to a client supplied structure
  284. *
  285. *)
  286. //typedef void *(*JackThreadCallback)(void* arg);
  287. TJackThreadCallback = function(arg: Pointer): Pointer; cdecl;
  288. (**
  289. * Prototype for the client supplied function that is called
  290. * once after the creation of the thread in which other
  291. * callbacks will be made. Special thread characteristics
  292. * can be set from this callback, for example. This is a
  293. * highly specialized callback and most clients will not
  294. * and should not use it.
  295. *
  296. * @param arg pointer to a client supplied structure
  297. *
  298. * @return void
  299. *)
  300. //typedef void (*JackThreadInitCallback)(void *arg);
  301. TJackThreadInitCallback = procedure(arg: Pointer); cdecl;
  302. (**
  303. * Prototype for the client supplied function that is called
  304. * whenever the processing graph is reordered.
  305. *
  306. * @param arg pointer to a client supplied structure
  307. *
  308. * @return zero on success, non-zero on error
  309. *)
  310. //typedef int (*JackGraphOrderCallback)(void *arg);
  311. TJackGraphOrderCallback = function(arg: Pointer): cint; cdecl;
  312. (**
  313. * Prototype for the client-supplied function that is called whenever
  314. * an xrun has occurred.
  315. *
  316. * @see jack_get_xrun_delayed_usecs()
  317. *
  318. * @param arg pointer to a client supplied structure
  319. *
  320. * @return zero on success, non-zero on error
  321. *)
  322. //typedef int (*JackXRunCallback)(void *arg);
  323. TJackXRunCallback = function(arg: Pointer): cint; cdecl;
  324. (**
  325. * Prototype for the @a bufsize_callback that is invoked whenever the
  326. * JACK engine buffer size changes. Although this function is called
  327. * in the JACK process thread, the normal process cycle is suspended
  328. * during its operation, causing a gap in the audio flow. So, the @a
  329. * bufsize_callback can allocate storage, touch memory not previously
  330. * referenced, and perform other operations that are not realtime
  331. * safe.
  332. *
  333. * @param nframes buffer size
  334. * @param arg pointer supplied by jack_set_buffer_size_callback().
  335. *
  336. * @return zero on success, non-zero on error
  337. *)
  338. //typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
  339. TJackBufferSizeCallback = function(nframes: jack_nframes_t; arg: Pointer): cint; cdecl;
  340. (**
  341. * Prototype for the client supplied function that is called
  342. * when the engine sample rate changes.
  343. *
  344. * @param nframes new engine sample rate
  345. * @param arg pointer to a client supplied structure
  346. *
  347. * @return zero on success, non-zero on error
  348. *)
  349. //typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
  350. TJackSampleRateCallback = function(nframes: jack_nframes_t; arg: Pointer): cint; cdecl;
  351. (**
  352. * Prototype for the client supplied function that is called
  353. * whenever a port is registered or unregistered.
  354. *
  355. * @param port the ID of the port
  356. * @param arg pointer to a client supplied data
  357. * @param register non-zero if the port is being registered,
  358. * zero if the port is being unregistered
  359. *)
  360. //typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int /* register */, void *arg);
  361. TJackPortRegistrationCallback = procedure(port: jack_port_id_t; register: cint; arg: Pointer); cdecl;
  362. (**
  363. * Prototype for the client supplied function that is called
  364. * whenever a client is registered or unregistered.
  365. *
  366. * @param name a null-terminated string containing the client name
  367. * @param register non-zero if the client is being registered,
  368. * zero if the client is being unregistered
  369. * @param arg pointer to a client supplied structure
  370. *)
  371. //typedef void (*JackClientRegistrationCallback)(const char* name, int /* register */, void *arg);
  372. TJackClientRegistrationCallback = procedure(name: PChar; register: cint; arg: Pointer); cdecl;
  373. (**
  374. * Prototype for the client supplied function that is called
  375. * whenever a port is connected or disconnected.
  376. *
  377. * @param a one of two ports connected or disconnected
  378. * @param b one of two ports connected or disconnected
  379. * @param connect non-zero if ports were connected
  380. * zero if ports were disconnected
  381. * @param arg pointer to a client supplied data
  382. *)
  383. //typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
  384. TJackPortConnectCallback = procedure(a, b: jack_port_id_t; connect: cint; arg: Pointer); cdecl;
  385. (**
  386. * Prototype for the client supplied function that is called
  387. * whenever the port name has been changed.
  388. *
  389. * @param port the port that has been renamed
  390. * @param new_name the new name
  391. * @param arg pointer to a client supplied structure
  392. *)
  393. //typedef void (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void *arg);
  394. TJackPortRenameCallback = procedure(port: jack_port_id_t; old_name, new_name: PChar; arg: Pointer); cdecl;
  395. (**
  396. * Prototype for the client supplied function that is called
  397. * whenever jackd starts or stops freewheeling.
  398. *
  399. * @param starting non-zero if we start starting to freewheel, zero otherwise
  400. * @param arg pointer to a client supplied structure
  401. *)
  402. //typedef void (*JackFreewheelCallback)(int starting, void *arg);
  403. TJackFreewheelCallback = procedure(starting: cint; arg: Pointer); cdecl;
  404. (**
  405. * Prototype for the client supplied function that is called
  406. * whenever jackd is shutdown. Note that after server shutdown,
  407. * the client pointer is *not* deallocated by libjack,
  408. * the application is responsible to properly use jack_client_close()
  409. * to release client resources. Warning: jack_client_close() cannot be
  410. * safely used inside the shutdown callback and has to be called outside of
  411. * the callback context.
  412. *
  413. * @param arg pointer to a client supplied structure
  414. *)
  415. //typedef void (*JackShutdownCallback)(void *arg);
  416. TJackShutdownCallback = procedure(arg: Pointer); cdecl;
  417. (**
  418. * Prototype for the client supplied function that is called
  419. * whenever jackd is shutdown. Note that after server shutdown,
  420. * the client pointer is *not* deallocated by libjack,
  421. * the application is responsible to properly use jack_client_close()
  422. * to release client resources. Warning: jack_client_close() cannot be
  423. * safely used inside the shutdown callback and has to be called outside of
  424. * the callback context.
  425. * @param code a status word, formed by OR-ing together the relevant @ref JackStatus bits.
  426. * @param reason a string describing the shutdown reason (backend failure, server crash... etc...).
  427. * Note that this string will not be available anymore after the callback returns, so possibly copy it.
  428. * @param arg pointer to a client supplied structure
  429. *)
  430. //typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
  431. TJackInfoShutdownCallback = procedure(code: jack_status_t; reason: PChar; arg: Pointer); cdecl;
  432. (**
  433. * Used for the type argument of jack_port_register() for default
  434. * audio ports and midi ports.
  435. *)
  436. const
  437. JACK_DEFAULT_AUDIO_TYPE = '32 bit float mono audio';
  438. JACK_DEFAULT_MIDI_TYPE = '8 bit raw midi';
  439. (**
  440. * For convenience, use this typedef if you want to be able to change
  441. * between float and double. You may want to typedef sample_t to
  442. * jack_default_audio_sample_t in your application.
  443. *)
  444. //typedef float jack_default_audio_sample_t;
  445. type
  446. PPjack_default_audio_sample_t = ^Pjack_default_audio_sample_t;
  447. Pjack_default_audio_sample_t = ^jack_default_audio_sample_t;
  448. jack_default_audio_sample_t = cfloat;
  449. (**
  450. * A port has a set of flags that are formed by AND-ing together the
  451. * desired values from the list below. The flags "JackPortIsInput" and
  452. * "JackPortIsOutput" are mutually exclusive and it is an error to use
  453. * them both.
  454. *)
  455. JackPortFlags = (
  456. (**
  457. * if JackPortIsInput is set, then the port can receive
  458. * data.
  459. *)
  460. JackPortIsInput = $1,
  461. (**
  462. * if JackPortIsOutput is set, then data can be read from
  463. * the port.
  464. *)
  465. JackPortIsOutput = $2,
  466. (**
  467. * if JackPortIsPhysical is set, then the port corresponds
  468. * to some kind of physical I/O connector.
  469. *)
  470. JackPortIsPhysical = $4,
  471. (**
  472. * if JackPortCanMonitor is set, then a call to
  473. * jack_port_request_monitor() makes sense.
  474. *
  475. * Precisely what this means is dependent on the client. A typical
  476. * result of it being called with TRUE as the second argument is
  477. * that data that would be available from an output port (with
  478. * JackPortIsPhysical set) is sent to a physical output connector
  479. * as well, so that it can be heard/seen/whatever.
  480. *
  481. * Clients that do not control physical interfaces
  482. * should never create ports with this bit set.
  483. *)
  484. JackPortCanMonitor = $8,
  485. (**
  486. * JackPortIsTerminal means:
  487. *
  488. * for an input port: the data received by the port
  489. * will not be passed on or made
  490. * available at any other port
  491. *
  492. * for an output port: the data available at the port
  493. * does not originate from any other port
  494. *
  495. * Audio synthesizers, I/O hardware interface clients, HDR
  496. * systems are examples of clients that would set this flag for
  497. * their ports.
  498. *)
  499. JackPortIsTerminal = $10
  500. );
  501. (**
  502. * Transport states.
  503. *)
  504. PPjack_transport_state_t = ^Pjack_transport_state_t;
  505. Pjack_transport_state_t = ^jack_transport_state_t;
  506. jack_transport_state_t = (
  507. (* the order matters for binary compatibility *)
  508. JackTransportStopped = 0, (**< Transport halted *)
  509. JackTransportRolling = 1, (**< Transport playing *)
  510. JackTransportLooping = 2, (**< For OLD_TRANSPORT, now ignored *)
  511. JackTransportStarting = 3, (**< Waiting for sync ready *)
  512. JackTransportNetStarting = 4 (**< Waiting for sync ready on the network*)
  513. );
  514. PPjack_unique_t = ^Pjack_unique_t;
  515. Pjack_unique_t = ^jack_unique_t;
  516. jack_unique_t = uint64_t; (**< Unique ID (opaque) *)
  517. (**
  518. * Optional struct jack_position_t fields.
  519. *)
  520. jack_position_bits_t = (
  521. JackPositionBBT = $10, (**< Bar, Beat, Tick *)
  522. JackPositionTimecode = $20, (**< External timecode *)
  523. JackBBTFrameOffset = $40, (**< Frame offset of BBT information *)
  524. JackAudioVideoRatio = $80, (**< audio frames per video frame *)
  525. JackVideoFrameOffset = $100, (**< frame offset of first video frame *)
  526. JackTickDouble = $200 (**< double-resolution tick *)
  527. );
  528. (** all valid position bits *)
  529. const
  530. JACK_POSITION_MASK = jack_position_bits_t(Ord(JackPositionBBT) or Ord(JackPositionTimecode));
  531. {$define EXTENDED_TIME_INFO}
  532. (** transport tick_double member is available for use *)
  533. {$define JACK_TICK_DOUBLE}
  534. type
  535. //PRE_PACKED_STRUCTURE
  536. _jack_position = packed record
  537. (* these four cannot be set from clients: the server sets them *)
  538. unique_1: jack_unique_t; (**< unique ID *)
  539. usecs: jack_time_t; (**< monotonic, free-rolling *)
  540. frame_rate: jack_nframes_t; (**< current frame rate (per second) *)
  541. frame: jack_nframes_t; (**< frame number, always present *)
  542. valid: jack_position_bits_t; (**< which other fields are valid *)
  543. (* JackPositionBBT fields: *)
  544. bar: int32_t; (**< current bar *)
  545. beat: int32_t; (**< current beat-within-bar *)
  546. tick: int32_t; (**< current tick-within-beat *)
  547. bar_start_tick: cdouble;
  548. beats_per_bar: cfloat; (**< time signature "numerator" *)
  549. beat_type: cfloat; (**< time signature "denominator" *)
  550. ticks_per_beat: cdouble;
  551. beats_per_minute: cdouble;
  552. (* JackPositionTimecode fields: (EXPERIMENTAL: could change) *)
  553. frame_time: cdouble; (**< current time in seconds *)
  554. next_time: cdouble; (**< next sequential frame_time
  555. (unless repositioned) *)
  556. (* JackBBTFrameOffset fields: *)
  557. bbt_offset: jack_nframes_t; (**< frame offset for the BBT fields
  558. (the given bar, beat, and tick
  559. values actually refer to a time
  560. frame_offset frames before the
  561. start of the cycle), should
  562. be assumed to be 0 if
  563. JackBBTFrameOffset is not
  564. set. If JackBBTFrameOffset is
  565. set and this value is zero, the BBT
  566. time refers to the first frame of this
  567. cycle. If the value is positive,
  568. the BBT time refers to a frame that
  569. many frames before the start of the
  570. cycle. *)
  571. (* JACK video positional data (experimental) *)
  572. audio_frames_per_video_frame: cfloat; (**< number of audio frames
  573. per video frame. Should be assumed
  574. zero if JackAudioVideoRatio is not
  575. set. If JackAudioVideoRatio is set
  576. and the value is zero, no video
  577. data exists within the JACK graph *)
  578. video_offset: jack_nframes_t; (**< audio frame at which the first video
  579. frame in this cycle occurs. Should
  580. be assumed to be 0 if JackVideoFrameOffset
  581. is not set. If JackVideoFrameOffset is
  582. set, but the value is zero, there is
  583. no video frame within this cycle. *)
  584. (* JACK extra transport fields *)
  585. tick_double: cdouble; (**< current tick-within-beat in double resolution.
  586. Should be assumed zero if JackTickDouble is not set.
  587. Since older versions of JACK do not expose this variable,
  588. the macro JACK_TICK_DOUBLE is provided,
  589. which can be used as build-time detection. *)
  590. (* For binary compatibility, new fields should be allocated from
  591. * this padding area with new valid bits controlling access, so
  592. * the existing structure size and offsets are preserved. *)
  593. padding: array [0..4] of int32_t;
  594. (* When (unique_1 == unique_2) the contents are consistent. *)
  595. unique_2: jack_unique_t; (**< unique ID *)
  596. end;// POST_PACKED_STRUCTURE;
  597. PPjack_position_t = ^Pjack_position_t;
  598. Pjack_position_t = ^jack_position_t;
  599. jack_position_t = _jack_position;
  600. (**
  601. * Prototype for the @a sync_callback defined by slow-sync clients.
  602. * When the client is active, this callback is invoked just before
  603. * process() in the same thread. This occurs once after registration,
  604. * then subsequently whenever some client requests a new position, or
  605. * the transport enters the ::JackTransportStarting state. This
  606. * realtime function must not wait.
  607. *
  608. * The transport @a state will be:
  609. *
  610. * - ::JackTransportStopped when a new position is requested;
  611. * - ::JackTransportStarting when the transport is waiting to start;
  612. * - ::JackTransportRolling when the timeout has expired, and the
  613. * position is now a moving target.
  614. *
  615. * @param state current transport state.
  616. * @param pos new transport position.
  617. * @param arg the argument supplied by jack_set_sync_callback().
  618. *
  619. * @return TRUE (non-zero) when ready to roll.
  620. *)
  621. TJackSyncCallback = function(state: jack_transport_state_t;
  622. pos: Pjack_position_t;
  623. arg: Pointer): cint; cdecl;
  624. (**
  625. * Prototype for the @a timebase_callback used to provide extended
  626. * position information. Its output affects all of the following
  627. * process cycle. This realtime function must not wait.
  628. *
  629. * This function is called immediately after process() in the same
  630. * thread whenever the transport is rolling, or when any client has
  631. * requested a new position in the previous cycle. The first cycle
  632. * after jack_set_timebase_callback() is also treated as a new
  633. * position, or the first cycle after jack_activate() if the client
  634. * had been inactive.
  635. *
  636. * The timebase master may not use its @a pos argument to set @a
  637. * pos->frame. To change position, use jack_transport_reposition() or
  638. * jack_transport_locate(). These functions are realtime-safe, the @a
  639. * timebase_callback can call them directly.
  640. *
  641. * @param state current transport state.
  642. * @param nframes number of frames in current period.
  643. * @param pos address of the position structure for the next cycle; @a
  644. * pos->frame will be its frame number. If @a new_pos is FALSE, this
  645. * structure contains extended position information from the current
  646. * cycle. If TRUE, it contains whatever was set by the requester.
  647. * The @a timebase_callback's task is to update the extended
  648. * information here.
  649. * @param new_pos TRUE (non-zero) for a newly requested @a pos, or for
  650. * the first cycle after the @a timebase_callback is defined.
  651. * @param arg the argument supplied by jack_set_timebase_callback().
  652. *)
  653. TJackTimebaseCallback = procedure(state: jack_transport_state_t;
  654. nframes: jack_nframes_t;
  655. pos: Pjack_position_t;
  656. new_pos: cint;
  657. arg: Pointer); cdecl;
  658. (*********************************************************************
  659. * The following interfaces are DEPRECATED. They are only provided
  660. * for compatibility with the earlier JACK transport implementation.
  661. *********************************************************************)
  662. (**
  663. * Optional struct jack_transport_info_t fields.
  664. *
  665. * @see jack_position_bits_t.
  666. *)
  667. jack_transport_bits_t = (
  668. JackTransportState = $1, (**< Transport state *)
  669. JackTransportPosition = $2, (**< Frame number *)
  670. JackTransportLoop = $4, (**< Loop boundaries (ignored) *)
  671. JackTransportSMPTE = $8, (**< SMPTE (ignored) *)
  672. JackTransportBBT = $10 (**< Bar, Beat, Tick *)
  673. );
  674. (**
  675. * Deprecated struct for transport position information.
  676. *
  677. * @deprecated This is for compatibility with the earlier transport
  678. * interface. Use the jack_position_t struct, instead.
  679. *)
  680. PPjack_transport_info_t = ^Pjack_transport_info_t;
  681. Pjack_transport_info_t = ^jack_transport_info_t;
  682. jack_transport_info_t = record
  683. (* these two cannot be set from clients: the server sets them *)
  684. frame_rate: jack_nframes_t; (**< current frame rate (per second) *)
  685. usecs: jack_time_t; (**< monotonic, free-rolling *)
  686. valid: jack_transport_bits_t; (**< which fields are legal to read *)
  687. transport_state: jack_transport_state_t;
  688. frame: jack_nframes_t;
  689. loop_start: jack_nframes_t;
  690. loop_end: jack_nframes_t;
  691. smpte_offset: clong; (**< SMPTE offset (from frame 0) *)
  692. smpte_frame_rate: cfloat; (**< 29.97, 30, 24 etc. *)
  693. bar: cint;
  694. beat: cint;
  695. tick: cint;
  696. bar_start_tick: cdouble;
  697. beats_per_bar: cfloat;
  698. beat_type: cfloat;
  699. ticks_per_beat: cdouble;
  700. beats_per_minute: cdouble;
  701. end;
  702. {$endif __jack_types_h__}