-
Notifications
You must be signed in to change notification settings - Fork 544
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 query fonction in ALC_SOFT_system_events unreleased extension #938
Add query fonction in ALC_SOFT_system_events unreleased extension #938
Conversation
…LC_SOFT_system_events unreleased extension The purpose of this addition (to my collection) are allow to retrieve which events are supported and if events are fully supported or if some case isn't managed for some reason For exemple only some backends provide system events: * pipewire -> Full support of extension * wasapi -> Full support of extension * pulseaudio -> Support of add and remove devices events only * coreaudio -> Support of default device change only
62b5dd2
to
80c6641
Compare
What does "partially supported" indicate? None of the backends seem to currently report it, what scenarios do you foresee it being used for? |
Cf following review : kcat#938 (comment)
In current implementation it's not very useful, but I've preferred to allow three states for events: full support, no support and partial support, so that libraries or backends implementing the extension can indicate that the event in question is only handled in certain cases. In my opinion, this is useful in the following cases:
P.S. : If cases presented here seems are too edge case or have no place here, I originally intended to offer only a boolean return code (AL_TRUE and AL_FALSE). |
This is what I'm not sure about. The events are pretty fine-grained and aren't that complicated; if it triggers the callback when a new device becomes available (or removed, etc) for a given device type, it's supported, if it doesn't, it's not. It's not like the query is for only the event type (where behavior can differ between playback and capture) or device type (where behavior can differ between added, removed, and default changed), it's querying both traits together. I don't see how it would partially support a given event for a given device type. The only meaning I could see it having in that case is that some events of a given type may be missed (e.g. a new playback device is added, and the callback randomly may or may not fire for it). Which would be a pretty significant bug that I'd be hesitant to knowingly leave in, as it would make the event unreliable and the app should just treat it as unsupported in that case anyway. But then again, maybe a future event type would make more sense to have a "partial support" response. Though without knowing what kind of event that would be, "partial support" may be too generic or ambiguous to indicate what the app should know about it and it would be better to wait for such events to be added to add appropriate query responses for it. But maybe adding a new query response in the future could cause compatibility issues if they would apply to existing events too, so having a generic "partial" response may be good to have just in case. Or maybe some apps would be fine with events not always firing if they don't use it for anything critical. I'm a bit torn. It probably wouldn't be a big deal to leave in as a "just in case", even if it never ends up used. |
In this case, a compromise could be as follows:
And define another extension (for example: ALC_SOFT_system_events_partial_support) dependent on ALC_SOFT_system_events adding the token:
In this way, extensions adding a new type of event to the callback that would need this token in addition of 2 primary tokens would depends on both extensions, while others would only need two primary tokens depends only on primary extension. With this system any other return tokens could be added as required with another extension (and possibly dedicated tokens for some specific event support).
Any new tokens should define their own meaning. |
In that case there's no point to having a separate |
Indeed, adding an extension to define the return token without the associated events is not useful. ^^' And yes, the backport of the new return type for an old event is absolutely unsuitable! P.S.: I remove the partial support token when i get home P.P.S.: Done |
Cf following discussions between this comment : kcat#938 (comment) to this comment : kcat#938 (comment)
The purpose of this PR are allow to retrieve which events are supported and if events are fully supported or if some case isn't managed for some reason.
Here, since extension isn't release, I would like to propose this addition to allow consumer of this extension to known eventual limitation on runtime (Because backend don't implement some event for example)
For exemple only some backends provide system events:
Here, for complete this goal, i propose following addition :