Jack2 1.9.14
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
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,
532} jack_transport_state_t;
533
534typedef uint64_t jack_unique_t;
539typedef enum {
540
541 JackPositionBBT = 0x10,
542 JackPositionTimecode = 0x20,
543 JackBBTFrameOffset = 0x40,
544 JackAudioVideoRatio = 0x80,
545 JackVideoFrameOffset = 0x100
547} jack_position_bits_t;
548
550#define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
551#define EXTENDED_TIME_INFO
552
553PRE_PACKED_STRUCTURE
555
556 /* these four cannot be set from clients: the server sets them */
557 jack_unique_t unique_1;
558 jack_time_t usecs;
559 jack_nframes_t frame_rate;
560 jack_nframes_t frame;
562 jack_position_bits_t valid;
564 /* JackPositionBBT fields: */
565 int32_t bar;
566 int32_t beat;
567 int32_t tick;
568 double bar_start_tick;
569
571 float beat_type;
572 double ticks_per_beat;
573 double beats_per_minute;
574
575 /* JackPositionTimecode fields: (EXPERIMENTAL: could change) */
576 double frame_time;
577 double next_time;
580 /* JackBBTFrameOffset fields: */
581 jack_nframes_t bbt_offset;
596 /* JACK video positional data (experimental) */
597
605 jack_nframes_t video_offset;
612 /* For binary compatibility, new fields should be allocated from
613 * this padding area with new valid bits controlling access, so
614 * the existing structure size and offsets are preserved. */
615 int32_t padding[7];
616
617 /* When (unique_1 == unique_2) the contents are consistent. */
618 jack_unique_t unique_2;
620} POST_PACKED_STRUCTURE;
621
622typedef struct _jack_position jack_position_t;
623
645typedef int (*JackSyncCallback)(jack_transport_state_t state,
646 jack_position_t *pos,
647 void *arg);
648
649
679typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
680 jack_nframes_t nframes,
681 jack_position_t *pos,
682 int new_pos,
683 void *arg);
684
685/*********************************************************************
686 * The following interfaces are DEPRECATED. They are only provided
687 * for compatibility with the earlier JACK transport implementation.
688 *********************************************************************/
689
695typedef enum {
696
697 JackTransportState = 0x1,
698 JackTransportPosition = 0x2,
699 JackTransportLoop = 0x4,
700 JackTransportSMPTE = 0x8,
701 JackTransportBBT = 0x10
703} jack_transport_bits_t;
704
711typedef struct {
712
713 /* these two cannot be set from clients: the server sets them */
714
715 jack_nframes_t frame_rate;
716 jack_time_t usecs;
718 jack_transport_bits_t valid;
719 jack_transport_state_t transport_state;
720 jack_nframes_t frame;
721 jack_nframes_t loop_start;
722 jack_nframes_t loop_end;
723
727 int bar;
728 int beat;
729 int tick;
730 double bar_start_tick;
731
732 float beats_per_bar;
733 float beat_type;
734 double ticks_per_beat;
735 double beats_per_minute;
736
738
739
740#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:618
double frame_time
Definition: types.h:576
int32_t tick
Definition: types.h:567
jack_position_bits_t valid
Definition: types.h:562
double next_time
Definition: types.h:577
jack_time_t usecs
Definition: types.h:558
float beats_per_bar
Definition: types.h:570
float beat_type
Definition: types.h:571
jack_unique_t unique_1
Definition: types.h:557
jack_nframes_t frame
Definition: types.h:560
jack_nframes_t video_offset
Definition: types.h:605
float audio_frames_per_video_frame
Definition: types.h:598
int32_t bar
Definition: types.h:565
jack_nframes_t bbt_offset
Definition: types.h:581
int32_t beat
Definition: types.h:566
jack_nframes_t frame_rate
Definition: types.h:559
float smpte_frame_rate
Definition: types.h:725
jack_transport_bits_t valid
Definition: types.h:718
jack_nframes_t frame_rate
Definition: types.h:715
jack_time_t usecs
Definition: types.h:716