XT-Audio
Structs.h
Go to the documentation of this file.
1 #ifndef XT_API_STRUCTS_H
2 #define XT_API_STRUCTS_H
3 
5 #include <xt/api/Enums.h>
6 #include <xt/api/Shared.h>
7 #include <xt/api/Callbacks.h>
8 
9 #include <stdint.h>
13 typedef struct XtMix XtMix;
14 typedef struct XtFormat XtFormat;
15 typedef struct XtBuffer XtBuffer;
16 typedef struct XtVersion XtVersion;
17 typedef struct XtLatency XtLatency;
18 typedef struct XtChannels XtChannels;
19 typedef struct XtErrorInfo XtErrorInfo;
20 typedef struct XtBufferSize XtBufferSize;
21 typedef struct XtAttributes XtAttributes;
22 typedef struct XtServiceError XtServiceError;
23 typedef struct XtStreamParams XtStreamParams;
29 struct XtMix
30 {
31  int32_t rate;
33 };
34 
35 struct XtBuffer
36 {
37  void const* input;
38  void* output;
39  double time;
40  uint64_t position;
41  int32_t frames;
43 };
44 
45 struct XtVersion
46 {
47  int32_t major;
48  int32_t minor;
49 };
50 
51 struct XtLatency
52 {
53  double input;
54  double output;
55 };
56 
57 struct XtChannels
58 {
59  int32_t inputs;
60  uint64_t inMask;
61  int32_t outputs;
62  uint64_t outMask;
63 };
64 
65 struct XtFormat
66 {
69 };
70 
72 {
74  char const* text;
75 };
76 
77 struct XtErrorInfo
78 {
79  uint32_t fault;
82 };
83 
85 {
86  double min;
87  double max;
88  double current;
89 };
90 
92 {
93  int32_t size;
94  int32_t count;
97 };
98 
100 {
105 };
106 
108 {
111  double bufferSize;
112 };
113 
115 {
118  double bufferSize;
119 };
120 
122 {
125  int32_t count;
127  XtDevice const* master;
128 };
129 
130 #endif // XT_API_STRUCTS_H
XtCause
Platform-independent error cause value.
Definition: Enums.h:6
int32_t major
Library major version.
Definition: Structs.h:47
void(XT_CALLBACK * XtOnXRun)(XtStream const *stream, int32_t index, void *user)
Audio xrun (underrun/overrun) callback.
Definition: Callbacks.h:16
Streaming audio buffer.
Definition: Structs.h:35
XtBool interleaved
Open the stream for interleaved access (true) or non-interleaved access (false).
Definition: Structs.h:101
Stream parameters specific to aggregated audio streams.
Definition: Structs.h:121
double time
The stream timestamp.
Definition: Structs.h:39
XtChannels channels
Channel specification for the current device.
Definition: Structs.h:117
Shared parameters for regular and aggregate audio streams.
Definition: Structs.h:99
Device buffer size limits.
Definition: Structs.h:84
XtSample
Audio sample format.
Definition: Enums.h:5
XtMix mix
The mix format, to be used by all streams in the aggregated stream.
Definition: Structs.h:126
int32_t minor
Library minor version.
Definition: Structs.h:48
double input
Input latency in milliseconds, or 0 when no inputs are present or latency is unknown.
Definition: Structs.h:53
uint64_t outMask
Output channel mask.
Definition: Structs.h:62
Audio stream format.
Definition: Structs.h:65
Audio mix format.
Definition: Structs.h:29
XtAggregateDeviceParams * devices
Pointer to an array of [count] device specific parameters.
Definition: Structs.h:124
XT-Audio library version information.
Definition: Structs.h:45
Device-specific parameters for opening an aggregate audio stream.
Definition: Structs.h:114
XtBool timeValid
Indicates whether the time and position fields are valid.
Definition: Structs.h:42
int32_t count
Number of elements in the devices array.
Definition: Structs.h:125
uint64_t position
The stream position.
Definition: Structs.h:40
Sample type attributes.
Definition: Structs.h:91
int32_t XtBool
Boolean type.
Definition: Shared.h:25
double bufferSize
Buffer size in milliseconds for the current device.
Definition: Structs.h:118
uint32_t(XT_CALLBACK * XtOnBuffer)(XtStream const *stream, XtBuffer const *buffer, void *user)
Audio stream processing callback.
Definition: Callbacks.h:18
XtOnBuffer onBuffer
The application-defined streaming audio callback.
Definition: Structs.h:102
XtBool isFloat
Indicates whether samples are integer or floating point.
Definition: Structs.h:95
Platform-independent error details.
Definition: Structs.h:71
struct XtDevice XtDevice
opaque audio device handle
Definition: Shared.h:30
int32_t frames
The number of frames in the input and/or output buffer.
Definition: Structs.h:41
Calling conventions and common data types.
XtSystem system
The system that generated the current error.
Definition: Structs.h:80
XtStreamParams stream
Specifies (non)interleaved access mode and application callbacks.
Definition: Structs.h:109
void const * input
The buffer containing data captured from the device, if any.
Definition: Structs.h:37
void * output
The buffer where the application writes it's output, if any.
Definition: Structs.h:38
double output
Output latency in milliseconds, or 0 when no outputs are present or latency is unknown.
Definition: Structs.h:54
XtOnXRun onXRun
The application-defined xrun callback (may be NULL).
Definition: Structs.h:103
XtBool isSigned
Indicates whether samples are signed or unsigned.
Definition: Structs.h:96
int32_t inputs
Input channel count.
Definition: Structs.h:59
XtChannels channels
Audio channel specification.
Definition: Structs.h:68
int32_t size
Sample size in bytes.
Definition: Structs.h:93
XtDevice const * master
The master device, will be used for synchronization.
Definition: Structs.h:127
char const * text
Pointer to a statically allocated string containing the error text for the given error.
Definition: Structs.h:74
XtCause cause
System-independent error cause indicating the type of error.
Definition: Structs.h:73
XtServiceError service
Platform-independent error details.
Definition: Structs.h:81
Useful error details derived from XtError opaque error code.
Definition: Structs.h:77
XtStreamParams stream
Specifies (non)interleaved access mode and application callbacks.
Definition: Structs.h:123
Enumeration types.
int32_t rate
Sample rate in Hz.
Definition: Structs.h:31
XtMix mix
Sample rate and type.
Definition: Structs.h:67
uint32_t fault
System-specific error code indicating the type of error.
Definition: Structs.h:79
uint64_t inMask
Input channel mask.
Definition: Structs.h:60
XtSystem
Platform-specific service identifier.
Definition: Enums.h:7
XtSample sample
Sample type.
Definition: Structs.h:32
XtFormat format
The audio format (must be supported).
Definition: Structs.h:110
XtOnRunning onRunning
The application-defined stream state changed callback (may be NULL).
Definition: Structs.h:104
int32_t count
Number of elements used to represent this sample in a buffer. 3 for 24-bit float, 1 for other types...
Definition: Structs.h:94
Stream latency.
Definition: Structs.h:51
double bufferSize
The desired buffer size in milliseconds (will be truncated to the supported range).
Definition: Structs.h:111
int32_t outputs
Output channel count.
Definition: Structs.h:61
double current
Current or default size in milliseconds, or 0 if unknown/unsupported.
Definition: Structs.h:88
XtDevice * device
Device to be part of the aggregated stream.
Definition: Structs.h:116
void(XT_CALLBACK * XtOnRunning)(XtStream const *stream, XtBool running, XtError error, void *user)
Audio stream state changed callback.
Definition: Callbacks.h:20
Stream parameters specific to regular (non-aggregated) audio streams.
Definition: Structs.h:107
double max
Maximum size in milliseconds, or 0 if unknown/unsupported.
Definition: Structs.h:87
Audio channel specification.
Definition: Structs.h:57
double min
Minimum size in milliseconds, or 0 if unknown/unsupported.
Definition: Structs.h:86
Callback function types.