Rust Audio

Extended LV2 export crate

Right now, the recommended way to use the rust-lv2 framework is to add each individual crate to the plugin’s Cargo.toml and not to use the lv2 re-export crate. This was decided because lv2 depends on every single crate in the framework and therefore would almost certainly add dependencies and therefore build time for plugins that don’t need it.

From our point of view, that’s okay, but for plugin creators, this adds some unnecessary complications: For example, they have to track which versions the individual sub-crates have after an update to update their Cargo.toml too. This requires dull and unnecessary research, since all versions are asynchronous. Also, plugin creators that want to explore the framework on their own and don’t want to read the book might simply not know of the different sub-crates and their updates. Lastly, it leaves the lv2 crate in a rather unnecessary position too since no one is supposed to use it.

I would therefore suggest to make more use of the lv2 crate: First of all, (almost) all dependencies should be optional, so plugin creators may opt in and out of crates as they like. This also gives us the ability to create feature groups that contain multiple crates for certain use-cases; For example a full feature with all crates, a bare-plugin with only the crates for a minimal plugin, plugin for a standard set, and ui-plugin for a plugin with UI. We could also add a prelude module to lv2 that contains the preludes of all enables crates, which would shorten the use block to only one line.

What do you think about that? It’s only a small change and a departure from our current design, but would improve the quality of live immensely.

I think this is a good idea. I see that you’ve already created a pull request for it :slight_smile: