nandi/jolt-nativepublic Fork 0
cfd3e3677bed92e80cfe447469a249cfdc0b1401
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

enumerate.rs · 36 lines · 688 BRust Blame HistoryRaw
Lift freeq's AV media plane out of sleek 90f8b89 nandi 19d ago1use std::vec::IntoIter as VecIntoIter;
2
3use super::Device;
4
5pub use crate::iter::{SupportedInputConfigs, SupportedOutputConfigs};
6
7// TODO: Support enumerating earpiece vs headset vs speaker etc?
8pub struct Devices(VecIntoIter<Device>);
9
10impl Devices {
11 pub fn new() -> Self {
12 Self::default()
13 }
14}
15
16impl Default for Devices {
17 fn default() -> Devices {
18 Devices(vec![Device].into_iter())
19 }
20}
21
22impl Iterator for Devices {
23 type Item = Device;
24
25 fn next(&mut self) -> Option<Device> {
26 self.0.next()
27 }
28}
29
30pub fn default_input_device() -> Option<Device> {
31 Some(Device)
32}
33
34pub fn default_output_device() -> Option<Device> {
35 Some(Device)
36}