Refer to OpenAL constants instead of instance variables. #2686
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Most likely, the intent was to allow users to override these values, but there isn't a clear use case for doing so. Audio libraries besides OpenAL might use other constants, but in that case
#if lime_openal
would fail and this code wouldn't even run.If this is merged, we could then clean up the 74 variables from
OpenALAudioContext
. (This is only a fraction of the constants listed inAL
, and I'm not sure why those 74 were picked. They aren't even all used.)Speaking of, I also don't think
**OpenAL**AudioContext
would function correctly if the backend library isn't OpenAL. I guess we could rename it to justAudioContext
and then add some backend-switching code... Oh wait, we already havelime.media.AudioContext
.Is there a use case I'm missing here? It just seems pointlessly risky to be using variables.