-
Notifications
You must be signed in to change notification settings - Fork 477
ASIO: open control panel #1074
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
base: master
Are you sure you want to change the base?
ASIO: open control panel #1074
Conversation
|
Hey! I think the asio-sys part is worth having regardless of the cpal API discussion. While I believe the ASIO control panels are blocking modals, it seems that PortAudio and JUCE also expose them. For the build script changes: the linker errors make sense - Re: the cpal API, I agree we should use extension traits rather than exposing this through // In src/platform/asio.rs or similar
#[cfg(all(target_os = "windows", feature = "asio"))]
pub trait AsioDeviceExt {
fn asio_open_control_panel(&self) -> Result<(), BackendSpecificError>;
}
impl AsioDeviceExt for Device {
fn asio_open_control_panel(&self) -> Result<(), BackendSpecificError> {
if let DeviceInner::Asio(ref d) = self.as_inner() {
d.open_control_panel()
} else {
// or maybe introduce a new error variant
Err(BackendSpecificError {
description: "Not an ASIO device".to_string(),
})
}
}
}Usage would be like: use cpal::platform::asio::AsioDeviceExt;
let device = host.default_output_device()?;
device.asio_open_control_panel()?;This keeps the main |
|
Had the above extension traits in mind for v0.18 by the way, not v0.17. |
|
Cool, trying out the extension trait now. It seems pretty nice! How I did it right now still has the problem with docs not generating though. |
roderickvd
left a comment
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.
Some considerations inline. Let's pay particular attention to getting the extension traits right. When we start adding them, it'd be highly desirable to keep them consistent and stable for the other hosts and time to come.
Also don't forget about a changelog entry.
examples/asio_panel.rs
Outdated
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.
What do you think about making this an example in asio-sys/examples instead?
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.
The example is a bit useless I think, was kind of intended to just show off that it works at all. With the extension trait it's not really necessary anymore.
|
@Sin-tel how's your extension traits experiment coming along? Not to haste - just checking in. |
|
Got distracted by other things. Mostly done now! Any idea why windows-crate-v0.61.3 is failing? EDIT: Seems like windows runners are randomly failing, I'm blaming github since it's all working fine for me locally. |
Just putting this here for now so people know it is at least possible.
Will have to think about a proper API if we want to include this. (extension traits?)
I would also be fine having this only exposed in asio-sys for now, but you'd need to expose driver internals if you want to use it from cpal.
Also, I had to modify the build script to get rid of linker errors, not sure what's up with that.