Jack2  1.9.10
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 uint64_t jack_uuid_t;
27 
28 typedef int32_t jack_shmsize_t;
29 
33 typedef 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 
44 typedef uint64_t jack_time_t;
45 
50 #define JACK_LOAD_INIT_LIMIT 1024
51 
57 typedef uint64_t jack_intclient_t;
58 
63 typedef struct _jack_port jack_port_t;
64 
69 typedef struct _jack_client jack_client_t;
70 
75 typedef uint32_t jack_port_id_t;
76 
77 typedef uint32_t jack_port_type_id_t;
78 
82 enum 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 
136 typedef enum JackOptions jack_options_t;
137 
141 enum 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 
222 typedef enum JackStatus jack_status_t;
223 
227 enum JackLatencyCallbackMode {
228 
234  JackCaptureLatency,
235 
241  JackPlaybackLatency
242 
243 };
244 
248 typedef enum JackLatencyCallbackMode jack_latency_callback_mode_t;
249 
259 typedef void (*JackLatencyCallback)(jack_latency_callback_mode_t mode, void *arg);
260 
264 PRE_PACKED_STRUCTURE
266 {
270  jack_nframes_t min;
274  jack_nframes_t max;
275 } POST_PACKED_STRUCTURE;
276 
278 
291 typedef int (*JackProcessCallback)(jack_nframes_t nframes, void *arg);
292 
300 typedef void *(*JackThreadCallback)(void* arg);
301 
314 typedef void (*JackThreadInitCallback)(void *arg);
315 
324 typedef int (*JackGraphOrderCallback)(void *arg);
325 
336 typedef int (*JackXRunCallback)(void *arg);
337 
352 typedef int (*JackBufferSizeCallback)(jack_nframes_t nframes, void *arg);
353 
363 typedef int (*JackSampleRateCallback)(jack_nframes_t nframes, void *arg);
364 
374 typedef void (*JackPortRegistrationCallback)(jack_port_id_t port, int /* register */, void *arg);
375 
385 typedef void (*JackClientRegistrationCallback)(const char* name, int /* register */, void *arg);
386 
397 typedef void (*JackPortConnectCallback)(jack_port_id_t a, jack_port_id_t b, int connect, void* arg);
398 
409 typedef int (*JackPortRenameCallback)(jack_port_id_t port, const char* old_name, const char* new_name, void *arg);
410 
418 typedef void (*JackFreewheelCallback)(int starting, void *arg);
419 
431 typedef void (*JackShutdownCallback)(void *arg);
432 
446 typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
447 
452 #define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio"
453 #define JACK_DEFAULT_MIDI_TYPE "8 bit raw midi"
454 
460 typedef float jack_default_audio_sample_t;
461 
468 enum JackPortFlags {
469 
474  JackPortIsInput = 0x1,
475 
480  JackPortIsOutput = 0x2,
481 
486  JackPortIsPhysical = 0x4,
487 
501  JackPortCanMonitor = 0x8,
502 
517  JackPortIsTerminal = 0x10,
518 
519 };
520 
524 typedef enum {
525 
526  /* the order matters for binary compatibility */
527  JackTransportStopped = 0,
528  JackTransportRolling = 1,
529  JackTransportLooping = 2,
530  JackTransportStarting = 3,
531  JackTransportNetStarting = 4,
533 } jack_transport_state_t;
534 
535 typedef uint64_t jack_unique_t;
540 typedef enum {
541 
542  JackPositionBBT = 0x10,
543  JackPositionTimecode = 0x20,
544  JackBBTFrameOffset = 0x40,
545  JackAudioVideoRatio = 0x80,
546  JackVideoFrameOffset = 0x100
548 } jack_position_bits_t;
549 
551 #define JACK_POSITION_MASK (JackPositionBBT|JackPositionTimecode)
552 #define EXTENDED_TIME_INFO
553 
554 PRE_PACKED_STRUCTURE
556 
557  /* these four cannot be set from clients: the server sets them */
558  jack_unique_t unique_1;
559  jack_time_t usecs;
560  jack_nframes_t frame_rate;
561  jack_nframes_t frame;
563  jack_position_bits_t valid;
565  /* JackPositionBBT fields: */
566  int32_t bar;
567  int32_t beat;
568  int32_t tick;
569  double bar_start_tick;
570 
572  float beat_type;
573  double ticks_per_beat;
574  double beats_per_minute;
575 
576  /* JackPositionTimecode fields: (EXPERIMENTAL: could change) */
577  double frame_time;
578  double next_time;
581  /* JackBBTFrameOffset fields: */
582  jack_nframes_t bbt_offset;
597  /* JACK video positional data (experimental) */
598 
606  jack_nframes_t video_offset;
613  /* For binary compatibility, new fields should be allocated from
614  * this padding area with new valid bits controlling access, so
615  * the existing structure size and offsets are preserved. */
616  int32_t padding[7];
617 
618  /* When (unique_1 == unique_2) the contents are consistent. */
619  jack_unique_t unique_2;
621 } POST_PACKED_STRUCTURE;
622 
623 typedef struct _jack_position jack_position_t;
624 
646 typedef int (*JackSyncCallback)(jack_transport_state_t state,
647  jack_position_t *pos,
648  void *arg);
649 
650 
680 typedef void (*JackTimebaseCallback)(jack_transport_state_t state,
681  jack_nframes_t nframes,
682  jack_position_t *pos,
683  int new_pos,
684  void *arg);
685 
686 /*********************************************************************
687  * The following interfaces are DEPRECATED. They are only provided
688  * for compatibility with the earlier JACK transport implementation.
689  *********************************************************************/
690 
696 typedef enum {
697 
698  JackTransportState = 0x1,
699  JackTransportPosition = 0x2,
700  JackTransportLoop = 0x4,
701  JackTransportSMPTE = 0x8,
702  JackTransportBBT = 0x10
704 } jack_transport_bits_t;
705 
712 typedef struct {
713 
714  /* these two cannot be set from clients: the server sets them */
715 
716  jack_nframes_t frame_rate;
717  jack_time_t usecs;
719  jack_transport_bits_t valid;
720  jack_transport_state_t transport_state;
721  jack_nframes_t frame;
722  jack_nframes_t loop_start;
723  jack_nframes_t loop_end;
724 
728  int bar;
729  int beat;
730  int tick;
731  double bar_start_tick;
732 
733  float beats_per_bar;
734  float beat_type;
735  double ticks_per_beat;
736  double beats_per_minute;
737 
739 
740 
741 #endif /* __jack_types_h__ */
double frame_time
Definition: types.h:577
jack_nframes_t video_offset
Definition: types.h:606
jack_nframes_t bbt_offset
Definition: types.h:582
jack_position_bits_t valid
Definition: types.h:563
float beat_type
Definition: types.h:572
jack_nframes_t min
Definition: types.h:270
int32_t tick
Definition: types.h:568
jack_unique_t unique_1
Definition: types.h:558
jack_nframes_t max
Definition: types.h:274
double next_time
Definition: types.h:578
float beats_per_bar
Definition: types.h:571
float audio_frames_per_video_frame
Definition: types.h:599
jack_nframes_t frame_rate
Definition: types.h:560
jack_transport_bits_t valid
Definition: types.h:719
jack_unique_t unique_2
Definition: types.h:619
jack_time_t usecs
Definition: types.h:559
jack_nframes_t frame_rate
Definition: types.h:716
jack_nframes_t frame
Definition: types.h:561
int32_t beat
Definition: types.h:567
int32_t bar
Definition: types.h:566
float smpte_frame_rate
Definition: types.h:726
jack_time_t usecs
Definition: types.h:717

Generated for Jack2 by doxygen 1.8.9.1