Jack2  1.9.8
types.h
1 /*
2  Copyright (C) 2001 Paul Davis
3  Copyright (C) 2004 Jack O'Quin
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation; either version 2.1 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 */
20 
21 #ifndef __jack_types_h__
22 #define __jack_types_h__
23 
24 #include <jack/systemdeps.h>
25 
26 typedef int32_t jack_shmsize_t;
27 
31 typedef uint32_t jack_nframes_t;
32 
36 #define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but C++ has a problem with that. */
37 
42 typedef uint64_t jack_time_t;
43 
48 #define JACK_LOAD_INIT_LIMIT 1024
49 
55 typedef uint64_t jack_intclient_t;
56 
61 typedef struct _jack_port jack_port_t;
62 
67 typedef struct _jack_client jack_client_t;
68 
73 typedef uint32_t jack_port_id_t;
74 
75 typedef uint32_t jack_port_type_id_t;
76 
80 enum JackOptions {
81 
85  JackNullOption = 0x00,
86 
93  JackNoStartServer = 0x01,
94 
99  JackUseExactName = 0x02,
100 
104  JackServerName = 0x04,
105 
110  JackLoadName = 0x08,
111 
116  JackLoadInit = 0x10,
117 
121  JackSessionID = 0x20
122 };
123 
125 #define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName)
126 
128 #define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
129 
134 typedef enum JackOptions jack_options_t;
135 
139 enum JackStatus {
140 
144  JackFailure = 0x01,
145 
149  JackInvalidOption = 0x02,
150 
160  JackNameNotUnique = 0x04,
161 
168  JackServerStarted = 0x08,
169 
173  JackServerFailed = 0x10,
174 
178  JackServerError = 0x20,
179 
183  JackNoSuchClient = 0x40,
184 
188  JackLoadFailure = 0x80,
189 
193  JackInitFailure = 0x100,
194 
198  JackShmFailure = 0x200,
199 
203  JackVersionError = 0x400,
204 
208  JackBackendError = 0x800,
209 
213  JackClientZombie = 0x1000
214 };
215 
220 typedef enum JackStatus jack_status_t;
221 
225 enum JackLatencyCallbackMode {
226 
232  JackCaptureLatency,
233 
239  JackPlaybackLatency
240 
241 };
242 
246 typedef enum JackLatencyCallbackMode jack_latency_callback_mode_t;
247 
257 typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg);
258 
263 {
267  jack_nframes_t min;
271  jack_nframes_t max;
272 };
273 
275 
288 typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
289 
297 typedef void *(*JackThreadCallback)(void* arg);
298 
311 typedef void (*JackThreadInitCallback)(void *arg);
312 
321 typedef int (*JackGraphOrderCallback)(void *arg);
322 
333 typedef int (*JackXRunCallback)(void *arg);
334 
349 typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
350 
360 typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
361 
371 typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int register, void *arg);
372 
382 typedef void (*JackClientRegistrationCallback)(const char* name, int register, void *arg);
383 
394 typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
395 
406 typedef int (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void *arg);
407 
415 typedef void (*JackFreewheelCallback)(int starting, void *arg);
416 
428 typedef void (*JackShutdownCallback)(void *arg);
429 
443 typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
444 
449 #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
450 #define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
451 
457 typedef float jack_default_audio_sample_t;
458 
465 enum JackPortFlags {
466 
471  JackPortIsInput = 0x1,
472 
477  JackPortIsOutput = 0x2,
478 
483  JackPortIsPhysical = 0x4,
484 
498  JackPortCanMonitor = 0x8,
499 
514  JackPortIsTerminal = 0x10,
515 
516 };
517 
521 typedef enum {
522 
523  /* the order matters for binary compatibility */
524  JackTransportStopped = 0,
525  JackTransportRolling = 1,
526  JackTransportLooping = 2,
527  JackTransportStarting = 3,
528  JackTransportNetStarting = 4,
530 } jack_transport_state_t;
531 
532 typedef uint64_t jack_unique_t;
537 typedef enum {
538 
539  JackPositionBBT = 0x10,
540  JackPositionTimecode = 0x20,
541  JackBBTFrameOffset = 0x40,
542  JackAudioVideoRatio = 0x80,
543  JackVideoFrameOffset = 0x100
545 } jack_position_bits_t;
546 
548 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
549 #define EXTENDED_TIME_INFO
550 
551 typedef struct {
552 
553  /* these four cannot be set from clients: the server sets them */
554  jack_unique_t unique_1;
555  jack_time_t usecs;
556  jack_nframes_t frame_rate;
557  jack_nframes_t frame;
559  jack_position_bits_t valid;
561  /* JackPositionBBT fields: */
562  int32_t bar;
563  int32_t beat;
564  int32_t tick;
565  double bar_start_tick;
566 
568  float beat_type;
569  double ticks_per_beat;
570  double beats_per_minute;
571 
572  /* JackPositionTimecode fields: (EXPERIMENTAL: could change) */
573  double frame_time;
574  double next_time;
577  /* JackBBTFrameOffset fields: */
578  jack_nframes_t bbt_offset;
593  /* JACK video positional data (experimental) */
594 
595  float audio_frames_per_video_frame;
602  jack_nframes_t video_offset;
609  /* For binary compatibility, new fields should be allocated from
610  * this padding area with new valid bits controlling access, so
611  * the existing structure size and offsets are preserved. */
612  int32_t padding[7];
613 
614  /* When (unique_1 == unique_2) the contents are consistent. */
615  jack_unique_t unique_2;
618 
640 typedef int (*JackSyncCallback)(jack_transport_state_t state,
641  jack_position_t *pos,
642  void *arg);
643 
644 
674 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
675  jack_nframes_t nframes,
676  jack_position_t *pos,
677  int new_pos,
678  void *arg);
679 
680 /*********************************************************************
681  * The following interfaces are DEPRECATED. They are only provided
682  * for compatibility with the earlier JACK transport implementation.
683  *********************************************************************/
684 
690 typedef enum {
691 
692  JackTransportState = 0x1,
693  JackTransportPosition = 0x2,
694  JackTransportLoop = 0x4,
695  JackTransportSMPTE = 0x8,
696  JackTransportBBT = 0x10
698 } jack_transport_bits_t;
699 
706 typedef struct {
707 
708  /* these two cannot be set from clients: the server sets them */
709 
710  jack_nframes_t frame_rate;
711  jack_time_t usecs;
713  jack_transport_bits_t valid;
714  jack_transport_state_t transport_state;
715  jack_nframes_t frame;
716  jack_nframes_t loop_start;
717  jack_nframes_t loop_end;
718 
722  int bar;
723  int beat;
724  int tick;
725  double bar_start_tick;
726 
727  float beats_per_bar;
728  float beat_type;
729  double ticks_per_beat;
730  double beats_per_minute;
731 
733 
734 
735 #endif /* __jack_types_h__ */

Generated for Jack2 by doxygen 1.8.1.2