diff --git a/Cargo.toml b/Cargo.toml index bc886c0..dd60735 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ keywords = ["audio", "sound"] [dependencies] libc = "*" lazy_static = "0.1" -winapi = "0.2.4" +winapi = "0.2.5" ole32-sys = "0.1" [target.i686-unknown-linux-gnu.dependencies.alsa-sys] diff --git a/src/wasapi/enumerate.rs b/src/wasapi/enumerate.rs index d6e6ef5..61bdbc8 100644 --- a/src/wasapi/enumerate.rs +++ b/src/wasapi/enumerate.rs @@ -69,7 +69,7 @@ impl Default for EndpointsIterator { unsafe { let mut collection: *mut winapi::IMMDeviceCollection = mem::uninitialized(); // 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, &mut collection)) .unwrap(); @@ -116,8 +116,8 @@ impl Iterator for EndpointsIterator { pub fn get_default_endpoint() -> Option { unsafe { let mut device = mem::uninitialized(); - let hres = (*ENUMERATOR.0).GetDefaultAudioEndpoint(winapi::EDataFlow::eRender, - winapi::ERole::eConsole, &mut device); + let hres = (*ENUMERATOR.0).GetDefaultAudioEndpoint(winapi::eRender, + winapi::eConsole, &mut device); if let Err(_err) = check_result(hres) { return None; // TODO: check specifically for `E_NOTFOUND`, and panic otherwise diff --git a/src/wasapi/voice.rs b/src/wasapi/voice.rs index bcadf47..1cf0fdf 100644 --- a/src/wasapi/voice.rs +++ b/src/wasapi/voice.rs @@ -43,7 +43,7 @@ impl Voice { // computing the format and initializing the device let 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 // a `WAVEFORMATEX`