-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add helpers for hog mode #83
Conversation
Does anyone have a moment to take a look at this? It's quite small with no breaking changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine to me? Will see if anyone else wants to comment, and approve in a short while if not.
@@ -1,17 +1,19 @@ | |||
//! A basic output stream example, using an Output AudioUnit to generate a sine wave. | |||
//! An output stream example showing more advanced usage. | |||
//! Tries to use hog mode to get exclusive access to the device. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok to me to make the advanced example contain one extra thing.
@@ -6,9 +6,9 @@ use std::collections::VecDeque; | |||
use std::sync::{Arc, Mutex}; | |||
|
|||
use coreaudio::audio_unit::audio_format::LinearPcmFlags; | |||
use coreaudio::audio_unit::macos_helpers::{audio_unit_from_device_id, get_default_device_id}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to leave formatting changes to their own commit and just re-format the whole repo to avoid any noise in future PRs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that was by mistake, didn't intend to include any formatting changes here.
Hopefully that iOS failure should be fixed the next time you run the checks. Pretty sure I fixed/worked-around it. |
Thanks for looking! I'll update asap :) |
I have updated this now. I went with "toggle_hog_mode()" and "get_hogging_pid()". Not the most elegant function names ever, but I think they are at least better than my first suggestion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runs fine for me
Doh looks like iOS build is failing again, after github actions upgraded to macOS 11 from 10. |
Looks like this fixes it #85 |
Thanks for reviewing and merging! And I see you already fixed the iOS build :) |
This adds two new helpers for managing hog mode (exclusive access).