diwic / alsa-rs

Thin but safe ALSA wrappers for Rust
Apache License 2.0
139 stars 66 forks source link

add handle_events to hctl api #86

Closed peng1999 closed 2 years ago

peng1999 commented 2 years ago

This is similar to #48, adding snd_hctl_handle_events to Hctl to make Hctl::wait actually useful.

diwic commented 2 years ago

Looks good and mergable to me, any reason why this is a draft?

peng1999 commented 2 years ago

I was not sure about the return type of the function then. The documentation of snd_hctl_handle_events says that it returns 0 or negative. But after reading the source code and doing some experiments, I found the function can also return positive values (at most time it is 1). So I changed the return type to Result<u32> like Mixer::handle_events.

I believe this PR is now ready to be merged.

diwic commented 2 years ago

Ok, merged now. Thanks!