jack2 codebase
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.

776 lines
25KB

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