Skip to content
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

Merged
merged 3 commits into from
Jan 31, 2022
Merged

Add helpers for hog mode #83

merged 3 commits into from
Jan 31, 2022

Conversation

HEnquist
Copy link
Contributor

This adds two new helpers for managing hog mode (exclusive access).

@HEnquist
Copy link
Contributor Author

Does anyone have a moment to take a look at this? It's quite small with no breaking changes.

Copy link
Contributor

@MichaelHills MichaelHills left a 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.
Copy link
Contributor

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};
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@MichaelHills
Copy link
Contributor

Hopefully that iOS failure should be fixed the next time you run the checks. Pretty sure I fixed/worked-around it.

@HEnquist
Copy link
Contributor Author

Thanks for looking! I'll update asap :)

@HEnquist
Copy link
Contributor Author

HEnquist commented Jan 7, 2022

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.

Copy link
Contributor

@MichaelHills MichaelHills left a 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

@MichaelHills MichaelHills merged commit da4f2ec into RustAudio:master Jan 31, 2022
@MichaelHills
Copy link
Contributor

Doh looks like iOS build is failing again, after github actions upgraded to macOS 11 from 10.

@MichaelHills
Copy link
Contributor

Looks like this fixes it #85

@HEnquist
Copy link
Contributor Author

Thanks for reviewing and merging! And I see you already fixed the iOS build :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants