Skip to content

Commit

Permalink
update windows crate
Browse files Browse the repository at this point in the history
  • Loading branch information
zzeneg committed Apr 28, 2024
1 parent bfb4be4 commit b79e976
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 19 deletions.
128 changes: 111 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ mpris = "2.0.1"

[target.'cfg(target_os = "windows")'.dependencies]
[dependencies.windows]
version = "0.48"
version = "0.56"
features = [
"implement",
"Foundation",
Expand All @@ -41,3 +41,5 @@ features = [
"Win32_UI_TextServices",
"Win32_UI_WindowsAndMessaging",
]
[dependencies.windows-core]
version = "0.56"
2 changes: 1 addition & 1 deletion src/providers/volume/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn get_volume() -> Result<f32, ()> {
}

unsafe fn get_volume_endpoint() -> Result<IAudioEndpointVolume, Error> {
CoInitializeEx(None, COINIT_MULTITHREADED).unwrap_or_else(|e| tracing::error!("{}", e));
let _ = CoInitializeEx(None, COINIT_MULTITHREADED);
let instance: windows::core::Result<IMMDeviceEnumerator> = CoCreateInstance(&MMDeviceEnumerator, None, CLSCTX_INPROC_SERVER);
return instance?
.GetDefaultAudioEndpoint(eRender, eMultimedia)?
Expand Down

0 comments on commit b79e976

Please sign in to comment.