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