4#include <qaudioformat.h>
5#include <qalgorithms.h>
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
59
60
61
62
63
64
65
66
67
68
69
72
73
74
75
78
79
80
81
84
85
86
87
90
91
92
93
96
97
98
99
102
103
104
105
108
109
110
111
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
146
147
148
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
177
178
179
180
181
182
183
186 m_channelConfig = config;
188 m_channelCount = qPopulationCount(config);
192
193
194
195
196
199 if (!(m_channelConfig & (1u << channel)))
202 uint maskedChannels = m_channelConfig & ((1u << channel) - 1);
203 return qPopulationCount(maskedChannels);
207
208
209
210
211
214
215
216
217
219
220
221
222
225
226
227
228
229
232
233
234
235
236
237
240
241
242
243
244
247
248
249
250
251
252
253
254
255
262
263
264
265
266
267
268
269
270
281 return qint64(1000000LL * (bytes / bytesPerFrame())) / sampleRate();
285
286
287
288
289
290
297
298
299
300
301
302
303
304
305
310 return byteCount / size;
315
316
317
318
319
325 return qint32((microseconds * sampleRate()) / 1000000LL);
329
330
340
341
342
343
344
345
346
349
350
351
352
353
356
357
358
361 switch (m_sampleFormat) {
363 return ((
float)*
reinterpret_cast<
const quint8 *>(sample))
364 / (
float)std::numeric_limits<qint8>::max()
367 return ((
float)*
reinterpret_cast<
const qint16 *>(sample))
368 / (
float)std::numeric_limits<qint16>::max();
370 return ((
float)*
reinterpret_cast<
const qint32 *>(sample))
371 / (
float)std::numeric_limits<qint32>::max();
373 return *
reinterpret_cast<
const float *>(sample);
383
384
385
386
387
388
389
393 switch (channelCount) {
430
431
432
433
434
435
436
437
438
439
440
441
442
443
445#ifndef QT_NO_DEBUG_STREAM
448 QDebugStateSaver saver(dbg);
Combined button and popup list for selecting options.