Restore CoreAudio support after API overhaul.

This commit is contained in:
Ronald Kinard 2015-09-23 22:02:28 -05:00
parent ffadfc990e
commit c841be235c
2 changed files with 147 additions and 80 deletions

View 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>;