Restore CoreAudio support after API overhaul.
This commit is contained in:
parent
ffadfc990e
commit
c841be235c
2 changed files with 147 additions and 80 deletions
29
src/coreaudio/enumerate.rs
Normal file
29
src/coreaudio/enumerate.rs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
use super::Endpoint;
|
||||
|
||||
use ::Format;
|
||||
|
||||
use std::vec::IntoIter as VecIntoIter;
|
||||
|
||||
pub struct EndpointsIterator(bool);
|
||||
|
||||
unsafe impl Send for EndpointsIterator {}
|
||||
unsafe impl Sync for EndpointsIterator {}
|
||||
|
||||
impl Default for EndpointsIterator {
|
||||
fn default() -> Self {
|
||||
EndpointsIterator(false)
|
||||
}
|
||||
}
|
||||
|
||||
impl Iterator for EndpointsIterator {
|
||||
type Item = Endpoint;
|
||||
fn next(&mut self) -> Option<Endpoint> {
|
||||
if self.0 { None } else { self.0 = true; Some(Endpoint) }
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_default_endpoint() -> Option<Endpoint> {
|
||||
Some(Endpoint)
|
||||
}
|
||||
|
||||
pub type SupportedFormatsIterator = VecIntoIter<Format>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue