Repository navigation
Add Support for IAudioClient2 and IAudioClient3 - #70
Conversation
|
Thanks, this fills a real gap. Answers to your questions first, then a few things to fix. 1. The range type. Please drop it and use a tuple. 2. Tests. There is now a device backed suite in
3. One bug. In Smaller things.
|
|
Out of curiosity, why the complete abstinence from ranges? I recognize that we have to do it now to remain consistent with existing APIs, so I will of course follow through, but why was this choice ever made in the first place?
Interesting. I just checked, and turns out the new will take care of the rest |
|
Nothing against ranges for modelling ranges. This just isn't one.
Named fields are what fits. If you don't like the tuple for |
|
Applied some of the feedback. Still not sure how to approach the tests, so I'll leave that to you. PS: The AI responses are demotivating. |
|
Sorry about the AI written comments. I'm short on time and used AI to cut a corner there. The points looked good to me, so I posted the suggestions as they were. But I should have written the feedback myself. I'm happy to finish the rest if you'd rather be done with it. |
Dunno what to write there😅
Added. FYI MSDN no longer exists, it was merged with TechNet into what is now MS Learn
Yeah this is what I am stuck on, I feel like the suggested tests would be mostly testing WASAPI itself. The library doesn't add any new invariants (at least in this case), so IMO there is nothing to test, except maybe the mutation of internal state in the init function, which is rather trivial. |
How about:
Yeah I know, it was called MSDN when I first started reading it and the name got stuck in my brain :) For And for tests, I agree there isn't much to test. I would add something for calling some method on the IAudioClient2&3, just to know the cast works as expected. You can skip it, I'll add something simple later. |
|
Done. |
|
Thanks! I hope to make a new release including this in the next few days. |
closes #68
Turns out there were a couple more methods missing, which I have also added while I was at it.
Unresolved questions:
The PR currently uses the new
RangeInclusive<T>type that will become the default in Rust 2027, which is recommended practice for new APIs to prevent future legacy burdens. This also allowsSharedModeEnginePeriodto deriveCopy. However, it raises the MSRV to 1.96. Is that a problem?What kind of tests should I add (if any)?
The docs of the
bEventDrivenparameter inIAudioClient2::GetBufferSizeLimits()states:The word "can" in that sentence confuses me, given that
bEventDrivenis an[in]parameter. Does this imply that the returned range is describing the union of both modes when the parameter is set totrue? If yes, then representing it with theTimingModeenum would be incorrect, as that implies mutual exclusivity. But I'd find WASAPI's API design rather strange in that case.