1
0
Fork 0
Commit graph

1354 commits

Author SHA1 Message Date
Robbert van der Helm bc60dc35b6 Fix rustdoc references 2022-02-01 20:53:20 +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 31481c406b Use Default::default() in the parameter examples
Makes it a bit easier to change between types if needed.
2022-02-01 20:15:33 +01:00
Robbert van der Helm 59b70eecae Add a sine test tone generator 2022-02-01 19:56:28 +01:00
Robbert van der Helm 15e0f6f21a Remove unnecessary import
I was going to add that set_parameter function in the next commit, but
that will need to wait a bit.
2022-02-01 19:54:35 +01:00
Robbert van der Helm 85bb37e037 Add a license to the gain example 2022-02-01 19:41:03 +01:00
Robbert van der Helm 49054b10f2 Break the workspace members array up in lines 2022-02-01 19:39:45 +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 98076ff792 Use a custom .spawn_unchecked without nightly req
Courtesy of Yandros on the Rust Discord.
2022-02-01 15:04:36 +01:00
Robbert van der Helm 9c93414d9c Fix rustup link in the readme 2022-02-01 03:25:26 +01:00
Robbert van der Helm 8a0e083168 Add a TODO and stub for parameter smoothing 2022-02-01 00:14:33 +01:00
Robbert van der Helm b15991a495 Add a todo and stub for setting parameter values 2022-02-01 00:01:52 +01:00
Robbert van der Helm 735cec4fba Update context docs 2022-02-01 00:01:43 +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 5aec636f9f Format boolean parameters as On/Off by default 2022-01-31 22:36:58 +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 6f67235c15 Show off the Default shorthand 2022-01-31 21:24:26 +01:00
Robbert van der Helm 54bcf52912 Add Default implementations for parameter types 2022-01-31 21:19:40 +01:00
Robbert van der Helm 6fc733e029 Add callbacks for parameter changes 2022-01-31 21:02:47 +01:00
Robbert van der Helm 44172da94f Use Arcs for the callbacks
So it becomes possible to reuse one callback for multiple parameters.
This will be important for value change notifications.
2022-01-31 20:44:10 +01:00
Robbert van der Helm c883e0000d Move the PersistentField implementations 2022-01-31 20:41:46 +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 2380768bad Add a Linux-specific event loop
Implementations for Windows and macOS should be fairly similar, but
using the OS' message loop instad of a thread.
2022-01-31 19:45:11 +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 2f59adadcc Update vst3-sys to a version with atomic refcounts 2022-01-31 19:42:35 +01:00
Robbert van der Helm b65158283a Support parking_lot mutexes and rwlocks 2022-01-31 19:42:35 +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 a4606f41cd Add more TODOs for parameters and persistence 2022-01-30 17:16:12 +01:00
Robbert van der Helm 64cf04a77d Add a todo about parking_lot 2022-01-30 17:10:42 +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 221e424f78 Use thread safe interior mutability for persist
Sadly there's not really a safe way to do this otherwise, but if you
really want to have persistence this way and absolutely need it to be
lock-free (because you're going to use it from the GUI thread), then you
can implement your own PersistentField.
2022-01-30 17:07:50 +01:00
Robbert van der Helm c1ea1e429f Use the persist attribute in the gain example 2022-01-30 16:16:15 +01:00
Robbert van der Helm 8ac036f6cc Add an API for persisting arbitrary fields 2022-01-30 16:14:52 +01:00