in src/backend/mod.rs [176:206]
fn from(label: CAChannelLabel) -> mixer::Channel {
use self::coreaudio_sys_utils::sys;
match label.0 {
sys::kAudioChannelLabel_Left => mixer::Channel::FrontLeft,
sys::kAudioChannelLabel_Right => mixer::Channel::FrontRight,
sys::kAudioChannelLabel_Center | sys::kAudioChannelLabel_Mono => {
mixer::Channel::FrontCenter
}
sys::kAudioChannelLabel_LFEScreen => mixer::Channel::LowFrequency,
sys::kAudioChannelLabel_LeftSurround => mixer::Channel::BackLeft,
sys::kAudioChannelLabel_RightSurround => mixer::Channel::BackRight,
sys::kAudioChannelLabel_LeftCenter => mixer::Channel::FrontLeftOfCenter,
sys::kAudioChannelLabel_RightCenter => mixer::Channel::FrontRightOfCenter,
sys::kAudioChannelLabel_CenterSurround => mixer::Channel::BackCenter,
sys::kAudioChannelLabel_LeftSurroundDirect => mixer::Channel::SideLeft,
sys::kAudioChannelLabel_RightSurroundDirect => mixer::Channel::SideRight,
sys::kAudioChannelLabel_TopCenterSurround => mixer::Channel::TopCenter,
sys::kAudioChannelLabel_VerticalHeightLeft => mixer::Channel::TopFrontLeft,
sys::kAudioChannelLabel_VerticalHeightCenter => mixer::Channel::TopFrontCenter,
sys::kAudioChannelLabel_VerticalHeightRight => mixer::Channel::TopFrontRight,
sys::kAudioChannelLabel_TopBackLeft => mixer::Channel::TopBackLeft,
sys::kAudioChannelLabel_TopBackCenter => mixer::Channel::TopBackCenter,
sys::kAudioChannelLabel_TopBackRight => mixer::Channel::TopBackRight,
sys::kAudioChannelLabel_Unknown => mixer::Channel::Discrete,
sys::kAudioChannelLabel_Unused => mixer::Channel::Silence,
v => {
eprintln!("Warning: channel label value {} isn't handled", v);
mixer::Channel::Silence
}
}
}