1#![no_std]
5#![allow(non_upper_case_globals)]
6#![allow(non_camel_case_types)]
7#![allow(non_snake_case)]
8
9pub use root::{soundtouch::*, TDStretch, uint};
10
11
12#[allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
13pub mod root {
14 #[doc = r" If Bindgen could only determine the size and alignment of a"]
15 #[doc = r" type, it is represented like this."]
16 #[derive(PartialEq, Copy, Clone, Debug, Hash)]
17 #[repr(C)]
18 pub struct __BindgenOpaqueArray<T: Copy, const N: usize>(pub [T; N]);
19 impl<T: Copy + Default, const N: usize> Default for __BindgenOpaqueArray<T, N> {
20 fn default() -> Self {
21 Self([<T as Default>::default(); N])
22 }
23 }
24 #[allow(unused_imports)]
25 use self::super::root;
26 pub mod std {
27 #[allow(unused_imports)]
28 use self::super::super::root;
29 pub mod __detail {
30 #[allow(unused_imports)]
31 use self::super::super::super::root;
32 }
33 #[repr(C)]
34 #[derive(Debug, Copy, Clone)]
35 pub struct allocator {
36 pub _address: u8,
37 }
38 pub type allocator_value_type = u8;
39 pub type allocator_size_type = u64;
40 pub type allocator_difference_type = u64;
41 pub type allocator_pointer = u8;
42 pub type allocator_const_pointer = u8;
43 pub type allocator_reference = u8;
44 pub type allocator_const_reference = u8;
45 #[repr(C)]
46 #[derive(Debug, Copy, Clone)]
47 pub struct allocator_rebind {
48 pub _address: u8,
49 }
50 pub type allocator_rebind_other = u8;
51 pub type allocator_propagate_on_container_move_assignment = u8;
52 pub type allocator_is_always_equal = u8;
53 #[repr(C)]
54 #[derive(Debug, Copy, Clone)]
55 pub struct vector {
56 pub _address: u8,
57 }
58 pub type vector__Base = u8;
59 pub type vector__Tp_alloc_type = u8;
60 pub type vector__Alloc_traits = u8;
61 pub type vector_value_type = u8;
62 pub type vector_pointer = u8;
63 pub type vector_const_pointer = u8;
64 pub type vector_reference = u8;
65 pub type vector_const_reference = u8;
66 pub type vector_iterator = u8;
67 pub type vector_const_iterator = u8;
68 pub type vector_const_reverse_iterator = u8;
69 pub type vector_reverse_iterator = u8;
70 pub type vector_size_type = u64;
71 pub type vector_difference_type = u64;
72 pub type vector_allocator_type = u8;
73 #[repr(C)]
74 #[derive(Debug, Copy, Clone)]
75 pub struct vector__Guard_alloc {
76 pub _address: u8,
77 }
78 #[repr(C)]
79 #[derive(Debug, Copy, Clone)]
80 pub struct vector__Temporary_value {
81 pub _address: u8,
82 }
83 #[repr(C)]
84 #[repr(align(1))]
85 #[derive(Copy, Clone)]
86 pub union vector__Temporary_value__Storage {
87 pub _bindgen_opaque_blob: u8,
88 }
89 }
90 pub mod __gnu_cxx {
91 #[allow(unused_imports)]
92 use self::super::super::root;
93 }
94 pub type uint = ::core::ffi::c_uint;
95 pub mod soundtouch {
96 #[allow(unused_imports)]
97 use self::super::super::root;
98 pub type SAMPLETYPE = f32;
99 pub type LONG_SAMPLETYPE = f32;
100 #[repr(C)]
101 pub struct FIFOSamplePipe__bindgen_vtable(::core::ffi::c_void);
102 #[doc = " Abstract base class for FIFO (first-in-first-out) sample processing classes."]
103 #[repr(C)]
104 #[derive(Debug)]
105 pub struct FIFOSamplePipe {
106 pub vtable_: *const FIFOSamplePipe__bindgen_vtable,
107 }
108 #[doc = " Base-class for sound processing routines working in FIFO principle. With this base\n class it's easy to implement sound processing stages that can be chained together,\n so that samples that are fed into beginning of the pipe automatically go through\n all the processing stages.\n\n When samples are input to this class, they're first processed and then put to\n the FIFO pipe that's defined as output of this class. This output pipe can be\n either other processing stage or a FIFO sample buffer."]
109 #[repr(C)]
110 #[derive(Debug)]
111 pub struct FIFOProcessor {
112 pub _base: root::soundtouch::FIFOSamplePipe,
113 #[doc = " Internal pipe where processed samples are put."]
114 pub output: *mut root::soundtouch::FIFOSamplePipe,
115 }
116 #[doc = " Sample buffer working in FIFO (first-in-first-out) principle. The class takes\n care of storage size adjustment and data moving during input/output operations.\n\n Notice that in case of stereo audio, one sample is considered to consist of\n both channel data."]
117 #[repr(C)]
118 #[derive(Debug)]
119 pub struct FIFOSampleBuffer {
120 pub _base: root::soundtouch::FIFOSamplePipe,
121 #[doc = " Sample buffer."]
122 pub buffer: *mut root::soundtouch::SAMPLETYPE,
123 pub bufferUnaligned: *mut root::soundtouch::SAMPLETYPE,
124 #[doc = " Sample buffer size in bytes"]
125 pub sizeInBytes: root::uint,
126 #[doc = " How many samples are currently in buffer."]
127 pub samplesInBuffer: root::uint,
128 #[doc = " Channels, 1=mono, 2=stereo."]
129 pub channels: root::uint,
130 #[doc = " Current position pointer to the buffer. This pointer is increased when samples are\n removed from the pipe so that it's necessary to actually rewind buffer (move data)\n only new data when is put to the pipe."]
131 pub bufferPos: root::uint,
132 }
133 unsafe extern "C" {
134 #[doc = " Returns a pointer to the end of the used part of the sample buffer (i.e.\n where the new samples are to be inserted). This function may be used for\n inserting new samples into the sample buffer directly. Please be careful\n not corrupt the book-keeping!\n\n When using this function as means for inserting new samples, also remember\n to increase the sample count afterwards, by calling the\n 'putSamples(numSamples)' function."]
135 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer6ptrEndEj"]
136 pub fn FIFOSampleBuffer_ptrEnd(
137 this: *mut root::soundtouch::FIFOSampleBuffer,
138 slackCapacity: root::uint,
139 ) -> *mut root::soundtouch::SAMPLETYPE;
140 }
141 unsafe extern "C" {
142 #[doc = " Sets number of channels, 1 = mono, 2 = stereo."]
143 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer11setChannelsEi"]
144 pub fn FIFOSampleBuffer_setChannels(
145 this: *mut root::soundtouch::FIFOSampleBuffer,
146 numChannels: ::core::ffi::c_int,
147 );
148 }
149 unsafe extern "C" {
150 #[doc = " Add silence to end of buffer"]
151 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer9addSilentEj"]
152 pub fn FIFOSampleBuffer_addSilent(
153 this: *mut root::soundtouch::FIFOSampleBuffer,
154 nSamples: root::uint,
155 );
156 }
157 unsafe extern "C" {
158 #[doc = " Constructor"]
159 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBufferC1Ei"]
160 pub fn FIFOSampleBuffer_FIFOSampleBuffer(
161 this: *mut root::soundtouch::FIFOSampleBuffer,
162 numChannels: ::core::ffi::c_int,
163 );
164 }
165 impl FIFOSampleBuffer {
166 #[inline]
167 pub unsafe fn ptrEnd(
168 &mut self,
169 slackCapacity: root::uint,
170 ) -> *mut root::soundtouch::SAMPLETYPE {
171 FIFOSampleBuffer_ptrEnd(self, slackCapacity)
172 }
173 #[inline]
174 pub unsafe fn setChannels(&mut self, numChannels: ::core::ffi::c_int) {
175 FIFOSampleBuffer_setChannels(self, numChannels)
176 }
177 #[inline]
178 pub unsafe fn addSilent(&mut self, nSamples: root::uint) {
179 FIFOSampleBuffer_addSilent(self, nSamples)
180 }
181 #[inline]
182 pub unsafe fn new(numChannels: ::core::ffi::c_int) -> Self {
183 let mut __bindgen_tmp = ::core::mem::MaybeUninit::uninit();
184 FIFOSampleBuffer_FIFOSampleBuffer(__bindgen_tmp.as_mut_ptr(), numChannels);
185 __bindgen_tmp.assume_init()
186 }
187 }
188 unsafe extern "C" {
189 #[doc = " destructor"]
190 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBufferD1Ev"]
191 pub fn FIFOSampleBuffer_FIFOSampleBuffer_destructor(
192 this: *mut root::soundtouch::FIFOSampleBuffer,
193 );
194 }
195 unsafe extern "C" {
196 #[doc = " Returns a pointer to the beginning of the output samples.\n This function is provided for accessing the output samples directly.\n Please be careful for not to corrupt the book-keeping!\n\n When using this function to output samples, also remember to 'remove' the\n output samples from the buffer by calling the\n 'receiveSamples(numSamples)' function"]
197 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer8ptrBeginEv"]
198 pub fn FIFOSampleBuffer_ptrBegin(
199 this: *mut ::core::ffi::c_void,
200 ) -> *mut root::soundtouch::SAMPLETYPE;
201 }
202 unsafe extern "C" {
203 #[doc = " Adds 'numSamples' pcs of samples from the 'samples' memory position to\n the sample buffer."]
204 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer10putSamplesEPKfj"]
205 pub fn FIFOSampleBuffer_putSamples(
206 this: *mut ::core::ffi::c_void,
207 samples: *const root::soundtouch::SAMPLETYPE,
208 numSamples: root::uint,
209 );
210 }
211 unsafe extern "C" {
212 #[doc = " Adjusts the book-keeping to increase number of samples in the buffer without\n copying any actual samples.\n\n This function is used to update the number of samples in the sample buffer\n when accessing the buffer directly with 'ptrEnd' function. Please be\n careful though!"]
213 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer10putSamplesEj"]
214 pub fn FIFOSampleBuffer_putSamples1(
215 this: *mut ::core::ffi::c_void,
216 numSamples: root::uint,
217 );
218 }
219 unsafe extern "C" {
220 #[doc = " Output samples from beginning of the sample buffer. Copies requested samples to\n output buffer and removes them from the sample buffer. If there are less than\n 'numsample' samples in the buffer, returns all that available.\n\n \\return Number of samples returned."]
221 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer14receiveSamplesEPfj"]
222 pub fn FIFOSampleBuffer_receiveSamples(
223 this: *mut ::core::ffi::c_void,
224 output: *mut root::soundtouch::SAMPLETYPE,
225 maxSamples: root::uint,
226 ) -> root::uint;
227 }
228 unsafe extern "C" {
229 #[doc = " Adjusts book-keeping so that given number of samples are removed from beginning of the\n sample buffer without copying them anywhere.\n\n Used to reduce the number of samples in the buffer when accessing the sample buffer directly\n with 'ptrBegin' function."]
230 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer14receiveSamplesEj"]
231 pub fn FIFOSampleBuffer_receiveSamples1(
232 this: *mut ::core::ffi::c_void,
233 maxSamples: root::uint,
234 ) -> root::uint;
235 }
236 unsafe extern "C" {
237 #[doc = " Returns number of samples currently available."]
238 #[link_name = "\u{1}_ZNK10soundtouch16FIFOSampleBuffer10numSamplesEv"]
239 pub fn FIFOSampleBuffer_numSamples(this: *mut ::core::ffi::c_void) -> root::uint;
240 }
241 unsafe extern "C" {
242 #[doc = " Returns nonzero if there aren't any samples available for outputting."]
243 #[link_name = "\u{1}_ZNK10soundtouch16FIFOSampleBuffer7isEmptyEv"]
244 pub fn FIFOSampleBuffer_isEmpty(this: *mut ::core::ffi::c_void) -> ::core::ffi::c_int;
245 }
246 unsafe extern "C" {
247 #[doc = " Clears all the samples."]
248 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer5clearEv"]
249 pub fn FIFOSampleBuffer_clear(this: *mut ::core::ffi::c_void);
250 }
251 unsafe extern "C" {
252 #[doc = " allow trimming (downwards) amount of samples in pipeline.\n Returns adjusted amount of samples"]
253 #[link_name = "\u{1}_ZN10soundtouch16FIFOSampleBuffer21adjustAmountOfSamplesEj"]
254 pub fn FIFOSampleBuffer_adjustAmountOfSamples(
255 this: *mut ::core::ffi::c_void,
256 numSamples: root::uint,
257 ) -> root::uint;
258 }
259 #[repr(C)]
260 #[derive(Debug, Copy, Clone)]
261 pub struct BEAT {
262 pub pos: f32,
263 pub strength: f32,
264 }
265 #[repr(C)]
266 #[derive(Debug, Copy, Clone)]
267 pub struct IIR2_filter {
268 pub coeffs: [f64; 5usize],
269 pub prev: [f64; 5usize],
270 }
271 unsafe extern "C" {
272 #[link_name = "\u{1}_ZN10soundtouch11IIR2_filter6updateEf"]
273 pub fn IIR2_filter_update(this: *mut root::soundtouch::IIR2_filter, x: f32) -> f32;
274 }
275 unsafe extern "C" {
276 #[link_name = "\u{1}_ZN10soundtouch11IIR2_filterC1EPKd"]
277 pub fn IIR2_filter_IIR2_filter(
278 this: *mut root::soundtouch::IIR2_filter,
279 lpf_coeffs: *const f64,
280 );
281 }
282 impl IIR2_filter {
283 #[inline]
284 pub unsafe fn update(&mut self, x: f32) -> f32 {
285 IIR2_filter_update(self, x)
286 }
287 #[inline]
288 pub unsafe fn new(lpf_coeffs: *const f64) -> Self {
289 let mut __bindgen_tmp = ::core::mem::MaybeUninit::uninit();
290 IIR2_filter_IIR2_filter(__bindgen_tmp.as_mut_ptr(), lpf_coeffs);
291 __bindgen_tmp.assume_init()
292 }
293 }
294 #[repr(C)]
295 pub struct BPMDetect__bindgen_vtable(::core::ffi::c_void);
296 #[doc = " Class for calculating BPM rate for audio data."]
297 #[repr(C)]
298 #[derive(Debug)]
299 pub struct BPMDetect {
300 pub vtable_: *const BPMDetect__bindgen_vtable,
301 #[doc = " Auto-correlation accumulator bins."]
302 pub xcorr: *mut f32,
303 #[doc = " Sample average counter."]
304 pub decimateCount: ::core::ffi::c_int,
305 #[doc = " Sample average accumulator for FIFO-like decimation."]
306 pub decimateSum: root::soundtouch::LONG_SAMPLETYPE,
307 #[doc = " Decimate sound by this coefficient to reach approx. 500 Hz."]
308 pub decimateBy: ::core::ffi::c_int,
309 #[doc = " Auto-correlation window length"]
310 pub windowLen: ::core::ffi::c_int,
311 #[doc = " Number of channels (1 = mono, 2 = stereo)"]
312 pub channels: ::core::ffi::c_int,
313 #[doc = " sample rate"]
314 pub sampleRate: ::core::ffi::c_int,
315 #[doc = " Beginning of auto-correlation window: Autocorrelation isn't being updated for\n the first these many correlation bins."]
316 pub windowStart: ::core::ffi::c_int,
317 #[doc = " window functions for data preconditioning"]
318 pub hamw: *mut f32,
319 pub hamw2: *mut f32,
320 pub pos: ::core::ffi::c_int,
321 pub peakPos: ::core::ffi::c_int,
322 pub beatcorr_ringbuffpos: ::core::ffi::c_int,
323 pub init_scaler: ::core::ffi::c_int,
324 pub peakVal: f32,
325 pub beatcorr_ringbuff: *mut f32,
326 #[doc = " FIFO-buffer for decimated processing samples."]
327 pub buffer: *mut root::soundtouch::FIFOSampleBuffer,
328 pub beats: root::__BindgenOpaqueArray<u64, 3usize>,
329 pub beat_lpf: root::soundtouch::IIR2_filter,
330 }
331 unsafe extern "C" {
332 #[doc = " Updates auto-correlation function for given number of decimated samples that\n are read from the internal 'buffer' pipe (samples aren't removed from the pipe\n though)."]
333 #[link_name = "\u{1}_ZN10soundtouch9BPMDetect11updateXCorrEi"]
334 pub fn BPMDetect_updateXCorr(
335 this: *mut root::soundtouch::BPMDetect,
336 process_samples: ::core::ffi::c_int,
337 );
338 }
339 unsafe extern "C" {
340 #[doc = " Decimates samples to approx. 500 Hz.\n\n \\return Number of output samples."]
341 #[link_name = "\u{1}_ZN10soundtouch9BPMDetect8decimateEPfPKfi"]
342 pub fn BPMDetect_decimate(
343 this: *mut root::soundtouch::BPMDetect,
344 dest: *mut root::soundtouch::SAMPLETYPE,
345 src: *const root::soundtouch::SAMPLETYPE,
346 numsamples: ::core::ffi::c_int,
347 ) -> ::core::ffi::c_int;
348 }
349 unsafe extern "C" {
350 #[doc = " Calculates amplitude envelope for the buffer of samples.\n Result is output to 'samples'."]
351 #[link_name = "\u{1}_ZN10soundtouch9BPMDetect12calcEnvelopeEPfi"]
352 pub fn BPMDetect_calcEnvelope(
353 this: *mut root::soundtouch::BPMDetect,
354 samples: *mut root::soundtouch::SAMPLETYPE,
355 numsamples: ::core::ffi::c_int,
356 );
357 }
358 unsafe extern "C" {
359 #[doc = " remove constant bias from xcorr data"]
360 #[link_name = "\u{1}_ZN10soundtouch9BPMDetect10removeBiasEv"]
361 pub fn BPMDetect_removeBias(this: *mut root::soundtouch::BPMDetect);
362 }
363 unsafe extern "C" {
364 #[link_name = "\u{1}_ZN10soundtouch9BPMDetect13updateBeatPosEi"]
365 pub fn BPMDetect_updateBeatPos(
366 this: *mut root::soundtouch::BPMDetect,
367 process_samples: ::core::ffi::c_int,
368 );
369 }
370 unsafe extern "C" {
371 #[doc = " Inputs a block of samples for analyzing: Envelopes the samples and then\n updates the autocorrelation estimation. When whole song data has been input\n in smaller blocks using this function, read the resulting bpm with 'getBpm'\n function.\n\n Notice that data in 'samples' array can be disrupted in processing."]
372 #[link_name = "\u{1}_ZN10soundtouch9BPMDetect12inputSamplesEPKfi"]
373 pub fn BPMDetect_inputSamples(
374 this: *mut root::soundtouch::BPMDetect,
375 samples: *const root::soundtouch::SAMPLETYPE,
376 numSamples: ::core::ffi::c_int,
377 );
378 }
379 unsafe extern "C" {
380 #[doc = " Analyzes the results and returns the BPM rate. Use this function to read result\n after whole song data has been input to the class by consecutive calls of\n 'inputSamples' function.\n\n \\return Beats-per-minute rate, or zero if detection failed."]
381 #[link_name = "\u{1}_ZN10soundtouch9BPMDetect6getBpmEv"]
382 pub fn BPMDetect_getBpm(this: *mut root::soundtouch::BPMDetect) -> f32;
383 }
384 unsafe extern "C" {
385 #[doc = " Get beat position arrays. Note: The array includes also really low beat detection values\n in absence of clear strong beats. Consumer may wish to filter low values away.\n - \"pos\" receive array of beat positions\n - \"values\" receive array of beat detection strengths\n - max_num indicates max.size of \"pos\" and \"values\" array.\n\n You can query a suitable array sized by calling this with NULL in \"pos\" & \"values\".\n\n \\return number of beats in the arrays."]
386 #[link_name = "\u{1}_ZN10soundtouch9BPMDetect8getBeatsEPfS1_i"]
387 pub fn BPMDetect_getBeats(
388 this: *mut root::soundtouch::BPMDetect,
389 pos: *mut f32,
390 strength: *mut f32,
391 max_num: ::core::ffi::c_int,
392 ) -> ::core::ffi::c_int;
393 }
394 unsafe extern "C" {
395 #[doc = " Constructor."]
396 #[link_name = "\u{1}_ZN10soundtouch9BPMDetectC1Eii"]
397 pub fn BPMDetect_BPMDetect(
398 this: *mut root::soundtouch::BPMDetect,
399 numChannels: ::core::ffi::c_int,
400 sampleRate: ::core::ffi::c_int,
401 );
402 }
403 impl BPMDetect {
404 #[inline]
405 pub unsafe fn updateXCorr(&mut self, process_samples: ::core::ffi::c_int) {
406 BPMDetect_updateXCorr(self, process_samples)
407 }
408 #[inline]
409 pub unsafe fn decimate(
410 &mut self,
411 dest: *mut root::soundtouch::SAMPLETYPE,
412 src: *const root::soundtouch::SAMPLETYPE,
413 numsamples: ::core::ffi::c_int,
414 ) -> ::core::ffi::c_int {
415 BPMDetect_decimate(self, dest, src, numsamples)
416 }
417 #[inline]
418 pub unsafe fn calcEnvelope(
419 &mut self,
420 samples: *mut root::soundtouch::SAMPLETYPE,
421 numsamples: ::core::ffi::c_int,
422 ) {
423 BPMDetect_calcEnvelope(self, samples, numsamples)
424 }
425 #[inline]
426 pub unsafe fn removeBias(&mut self) {
427 BPMDetect_removeBias(self)
428 }
429 #[inline]
430 pub unsafe fn updateBeatPos(&mut self, process_samples: ::core::ffi::c_int) {
431 BPMDetect_updateBeatPos(self, process_samples)
432 }
433 #[inline]
434 pub unsafe fn inputSamples(
435 &mut self,
436 samples: *const root::soundtouch::SAMPLETYPE,
437 numSamples: ::core::ffi::c_int,
438 ) {
439 BPMDetect_inputSamples(self, samples, numSamples)
440 }
441 #[inline]
442 pub unsafe fn getBpm(&mut self) -> f32 {
443 BPMDetect_getBpm(self)
444 }
445 #[inline]
446 pub unsafe fn getBeats(
447 &mut self,
448 pos: *mut f32,
449 strength: *mut f32,
450 max_num: ::core::ffi::c_int,
451 ) -> ::core::ffi::c_int {
452 BPMDetect_getBeats(self, pos, strength, max_num)
453 }
454 #[inline]
455 pub unsafe fn new(
456 numChannels: ::core::ffi::c_int,
457 sampleRate: ::core::ffi::c_int,
458 ) -> Self {
459 let mut __bindgen_tmp = ::core::mem::MaybeUninit::uninit();
460 BPMDetect_BPMDetect(__bindgen_tmp.as_mut_ptr(), numChannels, sampleRate);
461 __bindgen_tmp.assume_init()
462 }
463 }
464 unsafe extern "C" {
465 #[doc = " Destructor."]
466 #[link_name = "\u{1}_ZN10soundtouch9BPMDetectD1Ev"]
467 pub fn BPMDetect_BPMDetect_destructor(this: *mut root::soundtouch::BPMDetect);
468 }
469 #[repr(C)]
470 #[derive(Debug)]
471 pub struct SoundTouch {
472 pub _base: root::soundtouch::FIFOProcessor,
473 #[doc = " Rate transposer class instance"]
474 pub pRateTransposer: *mut root::RateTransposer,
475 #[doc = " Time-stretch class instance"]
476 pub pTDStretch: *mut root::TDStretch,
477 #[doc = " Virtual pitch parameter. Effective rate & tempo are calculated from these parameters."]
478 pub virtualRate: f64,
479 #[doc = " Virtual pitch parameter. Effective rate & tempo are calculated from these parameters."]
480 pub virtualTempo: f64,
481 #[doc = " Virtual pitch parameter. Effective rate & tempo are calculated from these parameters."]
482 pub virtualPitch: f64,
483 #[doc = " Flag: Has sample rate been set?"]
484 pub bSrateSet: bool,
485 #[doc = " Accumulator for how many samples in total will be expected as output vs. samples put in,\n considering current processing settings."]
486 pub samplesExpectedOut: f64,
487 #[doc = " Accumulator for how many samples in total have been read out from the processing so far"]
488 pub samplesOutput: ::core::ffi::c_long,
489 #[doc = " Number of channels"]
490 pub channels: root::uint,
491 #[doc = " Effective 'rate' value calculated from 'virtualRate', 'virtualTempo' and 'virtualPitch'"]
492 pub rate: f64,
493 #[doc = " Effective 'tempo' value calculated from 'virtualRate', 'virtualTempo' and 'virtualPitch'"]
494 pub tempo: f64,
495 }
496 unsafe extern "C" {
497 #[doc = " Get SoundTouch library version string"]
498 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch16getVersionStringEv"]
499 pub fn SoundTouch_getVersionString() -> *const ::core::ffi::c_char;
500 }
501 unsafe extern "C" {
502 #[doc = " Get SoundTouch library version Id"]
503 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch12getVersionIdEv"]
504 pub fn SoundTouch_getVersionId() -> root::uint;
505 }
506 unsafe extern "C" {
507 #[doc = " Sets new rate control value. Normal rate = 1.0, smaller values\n represent slower rate, larger faster rates."]
508 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch7setRateEd"]
509 pub fn SoundTouch_setRate(this: *mut root::soundtouch::SoundTouch, newRate: f64);
510 }
511 unsafe extern "C" {
512 #[doc = " Sets new tempo control value. Normal tempo = 1.0, smaller values\n represent slower tempo, larger faster tempo."]
513 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch8setTempoEd"]
514 pub fn SoundTouch_setTempo(this: *mut root::soundtouch::SoundTouch, newTempo: f64);
515 }
516 unsafe extern "C" {
517 #[doc = " Sets new rate control value as a difference in percents compared\n to the original rate (-50 .. +100 %)"]
518 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch13setRateChangeEd"]
519 pub fn SoundTouch_setRateChange(this: *mut root::soundtouch::SoundTouch, newRate: f64);
520 }
521 unsafe extern "C" {
522 #[doc = " Sets new tempo control value as a difference in percents compared\n to the original tempo (-50 .. +100 %)"]
523 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch14setTempoChangeEd"]
524 pub fn SoundTouch_setTempoChange(
525 this: *mut root::soundtouch::SoundTouch,
526 newTempo: f64,
527 );
528 }
529 unsafe extern "C" {
530 #[doc = " Sets new pitch control value. Original pitch = 1.0, smaller values\n represent lower pitches, larger values higher pitch."]
531 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch8setPitchEd"]
532 pub fn SoundTouch_setPitch(this: *mut root::soundtouch::SoundTouch, newPitch: f64);
533 }
534 unsafe extern "C" {
535 #[doc = " Sets pitch change in octaves compared to the original pitch\n (-1.00 .. +1.00)"]
536 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch15setPitchOctavesEd"]
537 pub fn SoundTouch_setPitchOctaves(
538 this: *mut root::soundtouch::SoundTouch,
539 newPitch: f64,
540 );
541 }
542 unsafe extern "C" {
543 #[doc = " Sets pitch change in semi-tones compared to the original pitch\n (-12 .. +12)"]
544 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch17setPitchSemiTonesEi"]
545 pub fn SoundTouch_setPitchSemiTones(
546 this: *mut root::soundtouch::SoundTouch,
547 newPitch: ::core::ffi::c_int,
548 );
549 }
550 unsafe extern "C" {
551 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch17setPitchSemiTonesEd"]
552 pub fn SoundTouch_setPitchSemiTones1(
553 this: *mut root::soundtouch::SoundTouch,
554 newPitch: f64,
555 );
556 }
557 unsafe extern "C" {
558 #[doc = " Sets the number of channels, 1 = mono, 2 = stereo"]
559 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch11setChannelsEj"]
560 pub fn SoundTouch_setChannels(
561 this: *mut root::soundtouch::SoundTouch,
562 numChannels: root::uint,
563 );
564 }
565 unsafe extern "C" {
566 #[doc = " Sets sample rate."]
567 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch13setSampleRateEj"]
568 pub fn SoundTouch_setSampleRate(
569 this: *mut root::soundtouch::SoundTouch,
570 srate: root::uint,
571 );
572 }
573 unsafe extern "C" {
574 #[doc = " Get ratio between input and output audio durations, useful for calculating\n processed output duration: if you'll process a stream of N samples, then\n you can expect to get out N * getInputOutputSampleRatio() samples.\n\n This ratio will give accurate target duration ratio for a full audio track,\n given that the the whole track is processed with same processing parameters.\n\n If this ratio is applied to calculate intermediate offsets inside a processing\n stream, then this ratio is approximate and can deviate +- some tens of milliseconds\n from ideal offset, yet by end of the audio stream the duration ratio will become\n exact.\n\n Example: if processing with parameters \"-tempo=15 -pitch=-3\", the function\n will return value 0.8695652... Now, if processing an audio stream whose duration\n is exactly one million audio samples, then you can expect the processed\n output duration be 0.869565 * 1000000 = 869565 samples."]
575 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch25getInputOutputSampleRatioEv"]
576 pub fn SoundTouch_getInputOutputSampleRatio(
577 this: *mut root::soundtouch::SoundTouch,
578 ) -> f64;
579 }
580 unsafe extern "C" {
581 #[doc = " Note: This function is meant for extracting the last samples of a sound\n stream. This function may introduce additional blank samples in the end\n of the sound stream, and thus it's not recommended to call this function\n in the middle of a sound stream."]
582 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch5flushEv"]
583 pub fn SoundTouch_flush(this: *mut root::soundtouch::SoundTouch);
584 }
585 unsafe extern "C" {
586 #[doc = " Changes a setting controlling the processing system behaviour. See the\n 'SETTING_...' defines for available setting ID's.\n\n \\return 'true' if the setting was successfully changed"]
587 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch10setSettingEii"]
588 pub fn SoundTouch_setSetting(
589 this: *mut root::soundtouch::SoundTouch,
590 settingId: ::core::ffi::c_int,
591 value: ::core::ffi::c_int,
592 ) -> bool;
593 }
594 unsafe extern "C" {
595 #[doc = " Reads a setting controlling the processing system behaviour. See the\n 'SETTING_...' defines for available setting ID's.\n\n \\return the setting value."]
596 #[link_name = "\u{1}_ZNK10soundtouch10SoundTouch10getSettingEi"]
597 pub fn SoundTouch_getSetting(
598 this: *const root::soundtouch::SoundTouch,
599 settingId: ::core::ffi::c_int,
600 ) -> ::core::ffi::c_int;
601 }
602 unsafe extern "C" {
603 #[link_name = "\u{1}_ZN10soundtouch10SoundTouchC1Ev"]
604 pub fn SoundTouch_SoundTouch(this: *mut root::soundtouch::SoundTouch);
605 }
606 impl SoundTouch {
607 #[inline]
608 pub unsafe fn getVersionString() -> *const ::core::ffi::c_char {
609 SoundTouch_getVersionString()
610 }
611 #[inline]
612 pub unsafe fn getVersionId() -> root::uint {
613 SoundTouch_getVersionId()
614 }
615 #[inline]
616 pub unsafe fn setRate(&mut self, newRate: f64) {
617 SoundTouch_setRate(self, newRate)
618 }
619 #[inline]
620 pub unsafe fn setTempo(&mut self, newTempo: f64) {
621 SoundTouch_setTempo(self, newTempo)
622 }
623 #[inline]
624 pub unsafe fn setRateChange(&mut self, newRate: f64) {
625 SoundTouch_setRateChange(self, newRate)
626 }
627 #[inline]
628 pub unsafe fn setTempoChange(&mut self, newTempo: f64) {
629 SoundTouch_setTempoChange(self, newTempo)
630 }
631 #[inline]
632 pub unsafe fn setPitch(&mut self, newPitch: f64) {
633 SoundTouch_setPitch(self, newPitch)
634 }
635 #[inline]
636 pub unsafe fn setPitchOctaves(&mut self, newPitch: f64) {
637 SoundTouch_setPitchOctaves(self, newPitch)
638 }
639 #[inline]
640 pub unsafe fn setPitchSemiTones(&mut self, newPitch: ::core::ffi::c_int) {
641 SoundTouch_setPitchSemiTones(self, newPitch)
642 }
643 #[inline]
644 pub unsafe fn setPitchSemiTones1(&mut self, newPitch: f64) {
645 SoundTouch_setPitchSemiTones1(self, newPitch)
646 }
647 #[inline]
648 pub unsafe fn setChannels(&mut self, numChannels: root::uint) {
649 SoundTouch_setChannels(self, numChannels)
650 }
651 #[inline]
652 pub unsafe fn setSampleRate(&mut self, srate: root::uint) {
653 SoundTouch_setSampleRate(self, srate)
654 }
655 #[inline]
656 pub unsafe fn getInputOutputSampleRatio(&mut self) -> f64 {
657 SoundTouch_getInputOutputSampleRatio(self)
658 }
659 #[inline]
660 pub unsafe fn flush(&mut self) {
661 SoundTouch_flush(self)
662 }
663 #[inline]
664 pub unsafe fn setSetting(
665 &mut self,
666 settingId: ::core::ffi::c_int,
667 value: ::core::ffi::c_int,
668 ) -> bool {
669 SoundTouch_setSetting(self, settingId, value)
670 }
671 #[inline]
672 pub unsafe fn getSetting(&self, settingId: ::core::ffi::c_int) -> ::core::ffi::c_int {
673 SoundTouch_getSetting(self, settingId)
674 }
675 #[inline]
676 pub unsafe fn new() -> Self {
677 let mut __bindgen_tmp = ::core::mem::MaybeUninit::uninit();
678 SoundTouch_SoundTouch(__bindgen_tmp.as_mut_ptr());
679 __bindgen_tmp.assume_init()
680 }
681 }
682 unsafe extern "C" {
683 #[link_name = "\u{1}_ZN10soundtouch10SoundTouchD1Ev"]
684 pub fn SoundTouch_SoundTouch_destructor(this: *mut root::soundtouch::SoundTouch);
685 }
686 unsafe extern "C" {
687 #[doc = " Adds 'numSamples' pcs of samples from the 'samples' memory position into\n the input of the object. Notice that sample rate _has_to_ be set before\n calling this function, otherwise throws a runtime_error exception."]
688 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch10putSamplesEPKfj"]
689 pub fn SoundTouch_putSamples(
690 this: *mut ::core::ffi::c_void,
691 samples: *const root::soundtouch::SAMPLETYPE,
692 numSamples: root::uint,
693 );
694 }
695 unsafe extern "C" {
696 #[doc = " Output samples from beginning of the sample buffer. Copies requested samples to\n output buffer and removes them from the sample buffer. If there are less than\n 'numsample' samples in the buffer, returns all that available.\n\n \\return Number of samples returned."]
697 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch14receiveSamplesEPfj"]
698 pub fn SoundTouch_receiveSamples(
699 this: *mut ::core::ffi::c_void,
700 output: *mut root::soundtouch::SAMPLETYPE,
701 maxSamples: root::uint,
702 ) -> root::uint;
703 }
704 unsafe extern "C" {
705 #[doc = " Adjusts book-keeping so that given number of samples are removed from beginning of the\n sample buffer without copying them anywhere.\n\n Used to reduce the number of samples in the buffer when accessing the sample buffer directly\n with 'ptrBegin' function."]
706 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch14receiveSamplesEj"]
707 pub fn SoundTouch_receiveSamples1(
708 this: *mut ::core::ffi::c_void,
709 maxSamples: root::uint,
710 ) -> root::uint;
711 }
712 unsafe extern "C" {
713 #[doc = " Clears all the samples in the object's output and internal processing\n buffers."]
714 #[link_name = "\u{1}_ZN10soundtouch10SoundTouch5clearEv"]
715 pub fn SoundTouch_clear(this: *mut ::core::ffi::c_void);
716 }
717 unsafe extern "C" {
718 #[doc = " Returns number of samples currently unprocessed."]
719 #[link_name = "\u{1}_ZNK10soundtouch10SoundTouch21numUnprocessedSamplesEv"]
720 pub fn SoundTouch_numUnprocessedSamples(this: *mut ::core::ffi::c_void) -> root::uint;
721 }
722 }
723 #[doc = " Rate transposer class instance"]
724 #[repr(C)]
725 #[derive(Debug, Copy, Clone)]
726 pub struct RateTransposer {
727 pub _address: u8,
728 }
729 #[doc = " Time-stretch class instance"]
730 #[repr(C)]
731 #[derive(Debug, Copy, Clone)]
732 pub struct TDStretch {
733 pub _address: u8,
734 }
735}