@@ -20,10 +20,12 @@ std::string& sPluginPath() {
2020namespace PluginFactory {
2121
2222uint32_t get_plugin_count (const clap_plugin_factory* factory) {
23- return sPlugins ().size ();
23+ (void )factory;
24+ return static_cast <uint32_t >(sPlugins ().size ());
2425}
2526
2627const clap_plugin_descriptor_t * get_plugin_descriptor (const clap_plugin_factory* factory, uint32_t index) {
28+ (void )factory;
2729 if (index < sPlugins ().size ()) {
2830 const PluginEntry& entry = sPlugins ()[index];
2931 return &entry.meta ;
@@ -32,6 +34,7 @@ const clap_plugin_descriptor_t* get_plugin_descriptor(const clap_plugin_factory*
3234}
3335
3436const clap_plugin_t * create_plugin (const clap_plugin_factory* factory, const clap_host_t * host, const char * pluginId) {
37+ (void )factory;
3538 if (!clap_version_is_compatible (host->clap_version )) {
3639 return nullptr ;
3740 }
@@ -40,7 +43,10 @@ const clap_plugin_t* create_plugin(const clap_plugin_factory* factory, const cla
4043
4144 for (const auto & entry : sPlugins ()) {
4245 if (std::string_view (entry.meta .id ) == pluginId) {
43- return entry.factory (cppHost)->GetOrCreatePluginObject (&entry.meta );
46+ BasePlugin* plugin = entry.factory (entry.meta );
47+ // intentionally using a setter here to hide the host from the factory function
48+ plugin->SetHost (host);
49+ return plugin->GetPluginObject ();
4450 }
4551 }
4652
@@ -56,11 +62,13 @@ const clap_plugin_factory_t value = {
5662
5763namespace PresetFactory {
5864uint32_t _count (const clap_preset_discovery_factory* factory) {
65+ (void )factory;
5966 return 1 ;
6067}
6168
6269const clap_preset_discovery_provider_descriptor_t * _get_descriptor (const clap_preset_discovery_factory* factory,
6370 uint32_t index) {
71+ (void )factory;
6472 if (index == 0 ) {
6573 return PresetProvider::Descriptor ();
6674 }
@@ -70,6 +78,8 @@ const clap_preset_discovery_provider_descriptor_t* _get_descriptor(const clap_pr
7078const clap_preset_discovery_provider_t * _create (const clap_preset_discovery_factory* factory,
7179 const clap_preset_discovery_indexer_t * indexer,
7280 const char * provider_id) {
81+ (void )factory;
82+ (void )provider_id;
7383 return PresetProvider::Create (indexer);
7484}
7585
0 commit comments