Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PluginEntry #75

Open
wants to merge 3 commits into
base: next
Choose a base branch
from
Open

PluginEntry #75

wants to merge 3 commits into from

Conversation

Trinitou
Copy link
Contributor

first version for a + clap::helpers::PluginEntry`

  • works for local plugin project (single-plugin clap, multi-plugin clap)
  • has the thread safety checks built-in
  • some basic test
  • some points I would rather leave for later as they are more on the optimization side:
    • only plugin_factory supported for now but it should be easy to add the other factories in the future
    • CLAP_HELPERS_UNLIKELY might be nice for some of the checks
    • the plugin_path on plugin_entry.init could be checked better (whether it's actually a valid path, see TODO comment)
    • maybe add some test for a multi-plugin plugin factory later

resolves #74 (this is a more general approach and leaves the actual implementation more up to the user which i think is better)

@baconpaul
Copy link
Collaborator

I'm still having a really hard time understanding this

here's a clap entry I wrote recently

https://github.com/baconpaul/sapphire-plugins/blob/main/src/clap/sapphire-clap-entry.cpp

and here's the implementation, implementing the plugin, vst3, and auv2 factory for a 4 plugin clap

https://github.com/baconpaul/sapphire-plugins/blob/main/src/clap/sapphire-clap-entry-impl.cpp

i'm not sure what would change if I used this code. Where would I put these objects?

@Trinitou
Copy link
Contributor Author

I'm still having a really hard time understanding this

here's a clap entry I wrote recently

https://github.com/baconpaul/sapphire-plugins/blob/main/src/clap/sapphire-clap-entry.cpp

and here's the implementation, implementing the plugin, vst3, and auv2 factory for a 4 plugin clap

https://github.com/baconpaul/sapphire-plugins/blob/main/src/clap/sapphire-clap-entry-impl.cpp

i'm not sure what would change if I used this code. Where would I put these objects?

hey @baconpaul I played around with this a bit and did a demo branch on how the code would change
https://github.com/Trinitou/sapphire-plugins/tree/plugin-entry-demo

There was also a missing bit that I just added (the getInstance method so that derived classes can access the static instance inside custom factories)

not sure whether you'll like it for your project but there it is at least 😅

include/clap/helpers/plugin-entry.hh Outdated Show resolved Hide resolved
include/clap/helpers/plugin-entry.hxx Outdated Show resolved Hide resolved
include/clap/helpers/plugin-entry.hxx Outdated Show resolved Hide resolved
@Trinitou Trinitou marked this pull request as ready for review February 3, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants