1
0
Fork 0
Commit graph

23 commits

Author SHA1 Message Date
Robbert van der Helm 95d7dabcee Downgrade unknown serialization fields to trace
Instead of being debug assertion failures. These are guaranteed to
trigger when using persistent fields together with nested param structs.
2023-04-05 16:13:16 +02:00
Robbert van der Helm b8cb2837d5 Fix plain #[nested] in Params proc macro
This is a regression from 727d88c4d7.
Fixes #51.
2023-01-15 02:13:53 +01:00
Robbert van der Helm e5a26ac199 Send individual parameter changes for VST3 plugins 2023-01-11 16:59:21 +01:00
Robbert van der Helm 753ca201a6 Support #[nested] prefixes/suffixes w/ #[persist]
This makes nested fields behave the same as nested parameters, allowing
multiple copies of a persistent field to exist.
2022-11-19 00:17:13 +01:00
Robbert van der Helm a69526c758 Preserve order for grouped params, fix persist
...for nested but not grouped parameters. This was a regression in
4affa40244.
2022-11-17 18:14:20 +01:00
Robbert van der Helm f5a2e0b6d7 Rename AnyParam to Param 2022-11-17 17:28:52 +01:00
Robbert van der Helm 055d649f7c Drop the singular Param struct 2022-11-17 17:28:12 +01:00
Simon Leiner 4affa40244
Preserve the order of non-grouped nested parameters 2022-11-13 20:38:48 +01:00
Simon Leiner d9797a606e
Move handling of NestedParams into a separate function 2022-11-13 20:38:48 +01:00
Robbert van der Helm bd295b7380 Move nih_plug::param to nih_plug::params 2022-10-20 12:26:12 +02:00
Robbert van der Helm 2a0ed0c5ec Move PersistentField and helpers to dedicated mod
As mentioned in the previous commit's breaking changes entry.
2022-10-20 12:11:04 +02:00
Robbert van der Helm 727d88c4d7 Add ID renaming superpowers to #[nested(...)]
This can now be used for most common use cases where you previously had
to do a manual `Params` implementation, like arrays of parameter objects
and duplicate parameter objects.
2022-10-13 01:28:05 +02:00
Robbert van der Helm c91b74355f Let rustfmt handle string wrapping 2022-07-03 16:52:38 +02:00
Robbert van der Helm 5e6e920418 Use BTreeMaps in the state
This ensures that the order is consistent when saving the same state
file multiple times.
2022-07-02 19:13:18 +02:00
Robbert van der Helm 9acd312768 Parmaeters are not real, they can't hurt you 2022-04-24 19:46:07 +02:00
Robbert van der Helm 2ae5aa429a Use nih_debug_assert_failure!() in derive macros
Instead of nih_log!(). These messages won't appear in release builds.
2022-04-11 17:47:32 +02:00
Robbert van der Helm 083885a40c Rework Params trait API with Arc instead of Pin
This is a breaking change requiring a small change to plugin
implementations.

The reason why `Pin<&dyn Params>` was used was more as a hint to
indicate that the object must last for the plugin's lifetime, but `Pin`
doesn't enforce that. It also makes the APIs a lot more awkward.
Requiring the use of `Arc` fixes the following problems:

- When storing the params object in the wrapper, the `ParamPtr`s are
  guaranteed to be stable.
- This makes it possible to access the `Params` object without acquiring
  a lock on the plugin, this is very important for implementing
  plugin-side preset management.
- It enforces immutability on the `Params` object.
- And of course the API is much nicer without a bunch of unsafe code to
  work around Pin's limitations.
2022-04-07 15:31:46 +02:00
Robbert van der Helm 9e3149b931 Move ParamPtr to the prelude 2022-03-23 12:46:46 +01:00
Robbert van der Helm c22e522629 Greatly simplify Params trait
This now is a single vector with all of the information in the correct
order instead of the hashmaps and a vector. This avoids deduplication,
and it especially makes manual `Params` implementations a lot more
convenient since you can't mess up with mismatching IDs between the
methods.

To accommodate exactly this, the persistent fields methods also have a
default implementation and the trait has been marked as `unsafe` since
it's the programmer's responsibility to make sure these `ParamPtr`s will
remain valid.
2022-03-20 13:05:02 +01:00
Robbert van der Helm b9d79771cc Use String instead of &'static str in Params
This may hurt performance in generic UIs a bit, but it will allow you to
programatically generate custom Params implementations for repeated
Parameters structs.
2022-03-20 02:14:18 +01:00
Robbert van der Helm 7460a12d98 Consider generic Params structs in derive macro 2022-03-18 14:09:17 +01:00
Robbert van der Helm 581e5911fc Add parameter groups with #[nested = "Group Name"] 2022-03-16 17:04:38 +01:00
Robbert van der Helm 6628baf47e Split up the nih_plug_derive crate into modules 2022-03-16 15:53:35 +01:00