1
0
Fork 0
Commit graph

167 commits

Author SHA1 Message Date
Robbert van der Helm
048d69213e Make the buffer own the output slices
This gets rid of a lot of lifetime casting and other unsoundness.
2022-02-02 14:41:35 +01:00
Robbert van der Helm
58736f5cc8 Add a super unsafe channel buffer adapter
To avoid having to perform lifetime magic here, this buffer needs to own
the slices and be stored as part of the RwLock.
2022-02-02 13:02:28 +01:00
Robbert van der Helm
7752ce6771 Add symmetrically and asymmetrically skewed ranges
This is super useful. I'm sure the symmetrical implementation can be
optimized a lot, but my math-fu was not strong enough today.
2022-02-01 23:37:28 +01:00
Robbert van der Helm
4aa85b43b4 Move parameter implementation details to a module 2022-02-01 21:01:28 +01:00
Robbert van der Helm
6bb83061dd Rename the params module to param
It's a heterogeneous module, and splitting the ranges to their own
module will be a bit weird otherwise.
2022-02-01 20:51:22 +01:00
Robbert van der Helm
473447179f Handle idempotent latency changes 2022-02-01 17:17:10 +01:00
Robbert van der Helm
e2e2c59d34 Pass the process context to the plugin 2022-02-01 17:09:23 +01:00
Robbert van der Helm
3a1fbed4c3 Mark MainThreadExecutor::execute as unsafe
This should only be called from the main thread. Otherwise the API's
threading guarantees will not be upheld.
2022-02-01 17:01:05 +01:00
Robbert van der Helm
459175b470 Call the component handler for restarts 2022-02-01 16:59:11 +01:00
Robbert van der Helm
223d0c3a90 Take a reference to the component handler 2022-02-01 16:52:55 +01:00
Robbert van der Helm
d47aac25a1 Rearrange WrapperInner parameters 2022-02-01 16:40:51 +01:00
Robbert van der Helm
565d9259c3 Use weak references to the executor
So this cyclic reference can't keep it alive.
2022-02-01 15:31:16 +01:00
Robbert van der Helm
f009384c2f Don't require Arcs for ProcessContext
It makes more sense to pass this as a reference, so the plugin cannot do
weird things with it.
2022-01-31 23:47:54 +01:00
Robbert van der Helm
22995df7ea Actually only calculate hashes once 2022-01-31 22:42:36 +01:00
Robbert van der Helm
7c57ac6737 Fix typo in hash overflow warning 2022-01-31 22:39:11 +01:00
Robbert van der Helm
0aad790fd7 Fix deserializing boolean parameters 2022-01-31 22:32:20 +01:00
Robbert van der Helm
85db4d82df Fix param_id_to_hash name
These were swapped for some reason.
2022-01-31 22:24:07 +01:00
Robbert van der Helm
880ee92a47 Drop param_id_to_hash
As it turns out, it's redundant (and also had the opposite name).
2022-01-31 22:23:29 +01:00
Robbert van der Helm
fe8f1d27d6 Use a stable ordering for the parameters
As the fields are specified on the parameters struct.
2022-01-31 22:20:09 +01:00
Robbert van der Helm
260d38580b Warn on parameter hash overflow 2022-01-31 21:34:36 +01:00
Robbert van der Helm
4734a51440 Move wrapper data to an inner struct
This fixes the soundness issue with the use of Arc. Moving a `Box` to an
`Arc` frees the old boxed data, and the internal reference counting
would also try to free that. As an added benefit, we no longer need the
unsafe Send+Sync implementation for the event loop.
2022-01-31 20:18:12 +01:00
Robbert van der Helm
6c518fad9d Add stubs for using the event loop in VST3 wrapper 2022-01-31 19:47:16 +01:00
Robbert van der Helm
4495064558 Redesign the wrapper's interiors for thread safety
There are a lot of locks needed now here, but none of them should be
contended. This is much better than potentially having RefCell's blow up
due to simultaneous mutable borrows, and the Arc is needed for the event
loop.
2022-01-31 19:44:02 +01:00
Robbert van der Helm
1a2c90fdfd Set the VST3 parameter step counts 2022-01-31 13:33:30 +01:00
Robbert van der Helm
6494d1ed5f Store persistent fields as plain JSON strings
On second thought, this is much better. The resulting file size will be
much smaller because only double quotes need to be escaped. It's also
easier to read at a glance.
2022-01-30 18:23:13 +01:00
Robbert van der Helm
3111d75b29 Serialize custom persistent fields as base64
This still takes up more space than plain JSON would, but I don't know
if serde_json would allow inlining that JSON. Presumably not. It would
get hairy quickly as a regular embedded JSON string due to the encoding.
2022-01-30 18:15:01 +01:00
Robbert van der Helm
29a0f83163 Add a TODO on packing stored state 2022-01-30 17:29:25 +01:00
Robbert van der Helm
f0ea9e9451 Fix broken rustdoc links 2022-01-30 17:17:34 +01:00
Robbert van der Helm
486fc67a4b Serialize persistent fields for VST3 plugins 2022-01-30 17:09:18 +01:00
Robbert van der Helm
b76b6e4a9b Add boolean parameters 2022-01-30 02:17:40 +01:00
Robbert van der Helm
7feb8006ef Persist the bypass parameter 2022-01-30 02:04:35 +01:00
Robbert van der Helm
16238f1e00 Support VST3 parameter flushes 2022-01-30 01:50:22 +01:00
Robbert van der Helm
6ddae6a506 Handle the output channel map
I apparently committed this a bit too early.
2022-01-30 01:43:40 +01:00
Robbert van der Helm
0c24398234 Target vst3-sys fork with better pointer semantics 2022-01-30 01:37:10 +01:00
Robbert van der Helm
902c3b2bf6 Upgrade vst3-sys dependency 2022-01-29 20:54:52 +01:00
Robbert van der Helm
3019f7aea6 Add a way to create VST3 bundles after building 2022-01-29 18:38:09 +01:00
Robbert van der Helm
47d102f2ba Implement restoring parameter values 2022-01-29 16:42:20 +01:00
Robbert van der Helm
ebb74a737c Use plain instead of unnormalized in the APIs
It takes more effort than what should be needed to tell normalized and
unnormalized apart at a glance.
2022-01-29 14:54:48 +01:00
Robbert van der Helm
97a88e0db2 Implement saving parameter state
Restoring is next.
2022-01-29 14:20:14 +01:00
Robbert van der Helm
f5f143b4f0 Read updated parmater values from the process data 2022-01-29 01:01:14 +01:00
Robbert van der Helm
59b1132d3b Mark hyperlinks in doc comments 2022-01-28 18:10:28 +01:00
Robbert van der Helm
6b7acb7cb5 Add TODO for wrapping parameter access in a mutex 2022-01-28 17:58:40 +01:00
Robbert van der Helm
e393b3e268 Add a todo for handling incoming parameter changes 2022-01-28 17:58:40 +01:00
Robbert van der Helm
7d0fce2f84 Implement audio processing 2022-01-28 17:58:40 +01:00
Robbert van der Helm
38bcf33a50 Use the precalculated bypass parameter hash 2022-01-28 14:52:04 +01:00
Robbert van der Helm
6439acad84 Use the correct vendor name 2022-01-28 14:20:16 +01:00
Robbert van der Helm
b14dc7eae9 Avoid duplicate units in VST3 parameter strings 2022-01-28 14:06:51 +01:00
Robbert van der Helm
47f84081dd Use a macro for the null pointer checks 2022-01-28 13:45:17 +01:00
Robbert van der Helm
b9d38f5c39 Implement most of IAudioProcessor
Except for the process function itself.
2022-01-28 13:40:47 +01:00
Robbert van der Helm
a34293fbb4 Silence too_many_arguments Clippy lint in wrapper
Aside from wrapping everything in another struct we can't really do
anything about this since this is all generated by the VST3 macro.
2022-01-28 13:39:44 +01:00