1
2
3
4
5
6
7
8
9
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
57
58
59
60
61
62
63
64
65
66
extern crate libsoundio_sys as raw;
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
pub enum DeviceAim {
Input,
Output,
}
impl From<raw::SoundIoDeviceAim> for DeviceAim {
fn from(aim: raw::SoundIoDeviceAim) -> DeviceAim {
match aim {
raw::SoundIoDeviceAim::SoundIoDeviceAimInput => DeviceAim::Input,
raw::SoundIoDeviceAim::SoundIoDeviceAimOutput => DeviceAim::Output,
}
}
}
impl From<DeviceAim> for raw::SoundIoDeviceAim {
fn from(aim: DeviceAim) -> raw::SoundIoDeviceAim {
match aim {
DeviceAim::Input => raw::SoundIoDeviceAim::SoundIoDeviceAimInput,
DeviceAim::Output => raw::SoundIoDeviceAim::SoundIoDeviceAimOutput,
}
}
}
#[derive(Debug, Copy, Clone)]
pub struct SampleRateRange {
pub min: i32,
pub max: i32,
}
impl From<raw::SoundIoSampleRateRange> for SampleRateRange {
fn from(range: raw::SoundIoSampleRateRange) -> SampleRateRange {
SampleRateRange {
min: range.min,
max: range.max,
}
}
}
impl From<SampleRateRange> for raw::SoundIoSampleRateRange {
fn from(range: SampleRateRange) -> raw::SoundIoSampleRateRange {
raw::SoundIoSampleRateRange {
min: range.min,
max: range.max,
}
}
}
#[derive(Debug, Copy, Clone)]
pub struct SoftwareLatency {
pub min: f64,
pub max: f64,
pub current: f64,
}