Jack2 1.9.22
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
26typedef uint64_t jack_uuid_t;
27
28typedef int32_t jack_shmsize_t;
29
33typedef uint32_t jack_nframes_t;
34
38#define JACK_MAX_FRAMES (4294967295U) /* This should be UINT32_MAX, but C++ has a problem with that. */
39
44typedef uint64_t jack_time_t;
45
50#define JACK_LOAD_INIT_LIMIT 1024
51
57typedef uint64_t jack_intclient_t;
58
63typedef struct _jack_port jack_port_t;
64
69typedef struct _jack_client jack_client_t;
70
75typedef uint32_t jack_port_id_t;
76
77typedef uint32_t jack_port_type_id_t;
78
82enum JackOptions {
83
87 JackNullOption = 0x00,
88
95 JackNoStartServer = 0x01,
96
101 JackUseExactName = 0x02,
102
106 JackServerName = 0x04,
107
112 JackLoadName = 0x08,
113
118 JackLoadInit = 0x10,
119
123 JackSessionID = 0x20
124};
125
127#define JackOpenOptions (JackSessionID|JackServerName|JackNoStartServer|JackUseExactName)
128
130#define JackLoadOptions (JackLoadInit|JackLoadName|JackUseExactName)
131
136typedef enum JackOptions jack_options_t;
137
141enum JackStatus {
142
146 JackFailure = 0x01,
147
151 JackInvalidOption = 0x02,
152
162 JackNameNotUnique = 0x04,
163
170 JackServerStarted = 0x08,
171
175 JackServerFailed = 0x10,
176
180 JackServerError = 0x20,
181
185 JackNoSuchClient = 0x40,
186
190 JackLoadFailure = 0x80,
191
195 JackInitFailure = 0x100,
196
200 JackShmFailure = 0x200,
201
205 JackVersionError = 0x400,
206
210 JackBackendError = 0x800,
211
215 JackClientZombie = 0x1000
216};
217
222typedef enum JackStatus jack_status_t;
223
227enum JackLatencyCallbackMode {
228
234 JackCaptureLatency,
235
241 JackPlaybackLatency
242
243};
244
248typedef enum JackLatencyCallbackMode jack_latency_callback_mode_t;
249
259typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg);
260
264PRE_PACKED_STRUCTURE
266{
270 jack_nframes_t min;
274 jack_nframes_t max;
275} POST_PACKED_STRUCTURE;
276
277typedef struct _jack_latency_range jack_latency_range_t;
278
291typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
292
300typedef void *(*JackThreadCallback)(void* arg);
301
314typedef void (*JackThreadInitCallback)(void *arg);
315
324typedef int (*JackGraphOrderCallback)(void *arg);
325
336typedef int (*JackXRunCallback)(void *arg);
337
352typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
353
363typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
364
374typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int /* register */, void *arg);
375
385typedef void (*JackClientRegistrationCallback)(const char* name, int /* register */, void *arg);
386
397typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
398
407typedef void (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void *arg);
408
416typedef void (*JackFreewheelCallback)(int starting, void *arg);
417
429typedef void (*JackShutdownCallback)(void *arg);
430
445typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
446
451#define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
452#define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
453
459typedef float jack_default_audio_sample_t;
460
467enum JackPortFlags {
468
473 JackPortIsInput = 0x1,
474
479 JackPortIsOutput = 0x2,
480
485 JackPortIsPhysical = 0x4,
486
500 JackPortCanMonitor = 0x8,
501
516 JackPortIsTerminal = 0x10,
517
518};
519
523typedef enum {
524
525 /* the order matters for binary compatibility */
526 JackTransportStopped = 0,
527 JackTransportRolling = 1,
528 JackTransportLooping = 2,
529 JackTransportStarting = 3,
530 JackTransportNetStarting = 4,
531
532} jack_transport_state_t;
533
534typedef uint64_t jack_unique_t;
535
539typedef enum {
540
541 JackPositionBBT = 0x10,
542 JackPositionTimecode = 0x20,
543 JackBBTFrameOffset = 0x40,
544 JackAudioVideoRatio = 0x80,
545 JackVideoFrameOffset = 0x100,
546 JackTickDouble = 0x200,
547
548} jack_position_bits_t;
549
551#define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
552#define EXTENDED_TIME_INFO
553
555#define JACK_TICK_DOUBLE
556
557PRE_PACKED_STRUCTURE
559
560 /* these four cannot be set from clients: the server sets them */
561 jack_unique_t unique_1;
562 jack_time_t usecs;
563 jack_nframes_t frame_rate;
564 jack_nframes_t frame;
565
566 jack_position_bits_t valid;
567
568 /* JackPositionBBT fields: */
569 int32_t bar;
570 int32_t beat;
571 int32_t tick;
572 double bar_start_tick;
573
575 float beat_type;
576 double ticks_per_beat;
577 double beats_per_minute;
578
579 /* JackPositionTimecode fields: (EXPERIMENTAL: could change) */
580 double frame_time;
581 double next_time;
583
584 /* JackBBTFrameOffset fields: */
585 jack_nframes_t bbt_offset;
599
600 /* JACK video positional data (experimental) */
601
608
609 jack_nframes_t video_offset;
615
616 /* JACK extra transport fields */
617
618 double tick_double;
623
624 /* For binary compatibility, new fields should be allocated from
625 * this padding area with new valid bits controlling access, so
626 * the existing structure size and offsets are preserved. */
627 int32_t padding[5];
628
629 /* When (unique_1 == unique_2) the contents are consistent. */
630 jack_unique_t unique_2;
631
632} POST_PACKED_STRUCTURE;
633
634typedef struct _jack_position jack_position_t;
635
657typedef int (*JackSyncCallback)(jack_transport_state_t state,
658 jack_position_t *pos,
659 void *arg);
660
661
691typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
692 jack_nframes_t nframes,
693 jack_position_t *pos,
694 int new_pos,
695 void *arg);
696
697/*********************************************************************
698 * The following interfaces are DEPRECATED. They are only provided
699 * for compatibility with the earlier JACK transport implementation.
700 *********************************************************************/
701
707typedef enum {
708
709 JackTransportState = 0x1,
710 JackTransportPosition = 0x2,
711 JackTransportLoop = 0x4,
712 JackTransportSMPTE = 0x8,
713 JackTransportBBT = 0x10
714
715} jack_transport_bits_t;
716
723typedef struct {
724
725 /* these two cannot be set from clients: the server sets them */
726
727 jack_nframes_t frame_rate;
728 jack_time_t usecs;
729
730 jack_transport_bits_t valid;
731 jack_transport_state_t transport_state;
732 jack_nframes_t frame;
733 jack_nframes_t loop_start;
734 jack_nframes_t loop_end;
735
738
739 int bar;
740 int beat;
741 int tick;
742 double bar_start_tick;
743
744 float beats_per_bar;
745 float beat_type;
746 double ticks_per_beat;
747 double beats_per_minute;
748
750
751
752#endif /* __jack_types_h__ */
jack_nframes_t max
Definition types.h:274
jack_nframes_t min
Definition types.h:270
jack_unique_t unique_2
Definition types.h:630
double frame_time
Definition types.h:580
int32_t tick
Definition types.h:571
jack_position_bits_t valid
Definition types.h:566
double next_time
Definition types.h:581
jack_time_t usecs
Definition types.h:562
float beats_per_bar
Definition types.h:574
float beat_type
Definition types.h:575
jack_unique_t unique_1
Definition types.h:561
jack_nframes_t frame
Definition types.h:564
jack_nframes_t video_offset
Definition types.h:609
float audio_frames_per_video_frame
Definition types.h:602
int32_t bar
Definition types.h:569
jack_nframes_t bbt_offset
Definition types.h:585
int32_t beat
Definition types.h:570
jack_nframes_t frame_rate
Definition types.h:563
double tick_double
Definition types.h:618
jack_transport_bits_t valid
Definition types.h:730
jack_nframes_t frame_rate
Definition types.h:727
jack_time_t usecs
Definition types.h:728