Merge pull request #88 from retep998/master

Update winapi
This commit is contained in:
tomaka 2015-11-10 07:38:26 +01:00
commit 57cf0f16f4
3 changed files with 5 additions and 5 deletions

View File

@ -12,7 +12,7 @@ keywords = ["audio", "sound"]
[dependencies] [dependencies]
libc = "*" libc = "*"
lazy_static = "0.1" lazy_static = "0.1"
winapi = "0.2.4" winapi = "0.2.5"
ole32-sys = "0.1" ole32-sys = "0.1"
[target.i686-unknown-linux-gnu.dependencies.alsa-sys] [target.i686-unknown-linux-gnu.dependencies.alsa-sys]

View File

@ -69,7 +69,7 @@ impl Default for EndpointsIterator {
unsafe { unsafe {
let mut collection: *mut winapi::IMMDeviceCollection = mem::uninitialized(); let mut collection: *mut winapi::IMMDeviceCollection = mem::uninitialized();
// can fail because of wrong parameters (should never happen) or out of memory // can fail because of wrong parameters (should never happen) or out of memory
check_result((*ENUMERATOR.0).EnumAudioEndpoints(winapi::EDataFlow::eRender, check_result((*ENUMERATOR.0).EnumAudioEndpoints(winapi::eRender,
winapi::DEVICE_STATE_ACTIVE, winapi::DEVICE_STATE_ACTIVE,
&mut collection)) &mut collection))
.unwrap(); .unwrap();
@ -116,8 +116,8 @@ impl Iterator for EndpointsIterator {
pub fn get_default_endpoint() -> Option<Endpoint> { pub fn get_default_endpoint() -> Option<Endpoint> {
unsafe { unsafe {
let mut device = mem::uninitialized(); let mut device = mem::uninitialized();
let hres = (*ENUMERATOR.0).GetDefaultAudioEndpoint(winapi::EDataFlow::eRender, let hres = (*ENUMERATOR.0).GetDefaultAudioEndpoint(winapi::eRender,
winapi::ERole::eConsole, &mut device); winapi::eConsole, &mut device);
if let Err(_err) = check_result(hres) { if let Err(_err) = check_result(hres) {
return None; // TODO: check specifically for `E_NOTFOUND`, and panic otherwise return None; // TODO: check specifically for `E_NOTFOUND`, and panic otherwise

View File

@ -43,7 +43,7 @@ impl Voice {
// computing the format and initializing the device // computing the format and initializing the device
let format = { let format = {
let format_attempt = try!(format_to_waveformatextensible(format)); let format_attempt = try!(format_to_waveformatextensible(format));
let share_mode = winapi::AUDCLNT_SHAREMODE::AUDCLNT_SHAREMODE_SHARED; let share_mode = winapi::AUDCLNT_SHAREMODE_SHARED;
// `IsFormatSupported` checks whether the format is supported and fills // `IsFormatSupported` checks whether the format is supported and fills
// a `WAVEFORMATEX` // a `WAVEFORMATEX`