This repository has been archived by the owner on Mar 27, 2024. It is now read-only.
Utility structs to make it easier to make plugins thread safe. #85
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.
This is a couple of structs to make it easier to handle the communication between the UI and processing threads. In particular, they will help when porting VST plugins from the old to the new API after #65 lands. The plan is to add an example (based on transfer_and_smooth) containing a detailed guide on how to port an existing plugin using
ParameterTransfer
.Before merging this, I would like some feedback on these issues:
General proofreading of the documentation. Is it adequate?
The
AtomicFloat
struct is specialized toRelaxed
ordering, because this is what is usually needed for VST parameters. For this reason, its accessors are calledget
andset
instead of the usualload
andstore
of atomics. An alternative could be to just haveload
andstore
operations that include an ordering parameter.A review of the
ParameterTransfer
data structure, especially its use of atomics. I have convinced myself that it upholds its promises no matter what happens, but more eyes are always useful.Both structs have been tested in real VST use with the exact same code as in this PR -
AtomicFloat
as part of the examples in #65, andParameterTransfer
as part of transfer_and_smooth.