1
0
Fork 0
Commit graph

973 commits

Author SHA1 Message Date
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
Robbert van der Helm
c286958c63 Swap around trait bound order 2022-01-30 13:15:42 +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
29d110aee7 Fix path for VST3 bundle creation 2022-01-30 00:24:44 +01:00
Robbert van der Helm
902c3b2bf6 Upgrade vst3-sys dependency 2022-01-29 20:54:52 +01:00
Robbert van der Helm
6fc4d80483 Change the id attribute to be a key value pair 2022-01-29 20:40:14 +01:00
Robbert van der Helm
2a1fdb5d9f Add a blank newline, because aesthetics 2022-01-29 18:43:07 +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
46cd75ec53 Add an xtask binary target for running tasks 2022-01-29 17:31:51 +01:00
Robbert van der Helm
edab467538 Mention all channel lengths being equal 2022-01-29 16:45:33 +01:00
Robbert van der Helm
47d102f2ba Implement restoring parameter values 2022-01-29 16:42:20 +01:00
Robbert van der Helm
dabd2beca8 Add functions for interacting with plain values 2022-01-29 14:59:59 +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
ef021915e5 Move the PlainParam functions to a trait
We can use this for setting parameter values, as a &Param can be turned
into a pointer which can then later be mapped to a parameter ID to
handle outputting parameter values.
2022-01-29 13:39:01 +01:00
Robbert van der Helm
5697183918 Rename from_string to set_from_string
To make it a bit more obvious at a glance that this mutates the
parameter.
2022-01-29 13:32:31 +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
673180fb6b Update vst3-sys dependency
So the VST3 macro works for types with lifetime bounds.
2022-01-28 16:29:09 +01:00
Robbert van der Helm
61d7905148 Add a todo for transport information in process 2022-01-28 15:18:55 +01:00
Robbert van der Helm
c518cc9ede Add a note about licensing 2022-01-28 15:02:55 +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
3064132821 Improve and simplify token handling in macros
The standard library macros also use a `$($foo:tt)*` for this, so we
should probably too. Since eprinln!() already handles trailing commas we
don't need to do any special handling, and this fixes parsing with
complex expressions as arguments.
2022-01-28 14:47:26 +01:00
Robbert van der Helm
71dc144c73 Add a simple formatters library
We can add common formats here so you don't need to repeat them all the
time.
2022-01-28 14:33:29 +01:00
Robbert van der Helm
6439acad84 Use the correct vendor name 2022-01-28 14:20:16 +01:00