| @@ -2579,15 +2579,8 @@ public: | |||||
| File bundlePath; | File bundlePath; | ||||
| URL pluginUri; | URL pluginUri; | ||||
| auto withBundlePath (File v) const noexcept { return with (&UiInstanceArgs::bundlePath, std::move (v)); } | |||||
| auto withPluginUri (URL v) const noexcept { return with (&UiInstanceArgs::pluginUri, std::move (v)); } | |||||
| private: | |||||
| template <typename Member> | |||||
| UiInstanceArgs with (Member UiInstanceArgs::* member, Member value) const noexcept | |||||
| { | |||||
| return juce::lv2_host::with (*this, member, std::move (value)); | |||||
| } | |||||
| auto withBundlePath (File v) const noexcept { return withMember (*this, &UiInstanceArgs::bundlePath, std::move (v)); } | |||||
| auto withPluginUri (URL v) const noexcept { return withMember (*this, &UiInstanceArgs::pluginUri, std::move (v)); } | |||||
| }; | }; | ||||
| static File bundlePathFromUri (const char* uri) | static File bundlePathFromUri (const char* uri) | ||||
| @@ -2614,7 +2607,7 @@ public: | |||||
| mLV2_UI__floatProtocol (map.map (LV2_UI__floatProtocol)), | mLV2_UI__floatProtocol (map.map (LV2_UI__floatProtocol)), | ||||
| mLV2_ATOM__atomTransfer (map.map (LV2_ATOM__atomTransfer)), | mLV2_ATOM__atomTransfer (map.map (LV2_ATOM__atomTransfer)), | ||||
| mLV2_ATOM__eventTransfer (map.map (LV2_ATOM__eventTransfer)), | mLV2_ATOM__eventTransfer (map.map (LV2_ATOM__eventTransfer)), | ||||
| instance (makeInstance (args.pluginUri, args.bundlePath, features)), | |||||
| instance (makeInstance (args, features)), | |||||
| idleCallback (getExtensionData<LV2UI_Idle_Interface> (world, LV2_UI__idleInterface)) | idleCallback (getExtensionData<LV2UI_Idle_Interface> (world, LV2_UI__idleInterface)) | ||||
| { | { | ||||
| jassert (descriptor != nullptr); | jassert (descriptor != nullptr); | ||||
| @@ -2682,14 +2675,14 @@ private: | |||||
| using Instance = std::unique_ptr<void, void (*) (LV2UI_Handle)>; | using Instance = std::unique_ptr<void, void (*) (LV2UI_Handle)>; | ||||
| using Idle = int (*) (LV2UI_Handle); | using Idle = int (*) (LV2UI_Handle); | ||||
| Instance makeInstance (const URL& pluginUri, const File& bundlePath, const LV2_Feature* const* features) | |||||
| Instance makeInstance (const UiInstanceArgs& args, const LV2_Feature* const* features) | |||||
| { | { | ||||
| if (descriptor->get() == nullptr) | if (descriptor->get() == nullptr) | ||||
| return { nullptr, [] (LV2UI_Handle) {} }; | return { nullptr, [] (LV2UI_Handle) {} }; | ||||
| return Instance { descriptor->get()->instantiate (descriptor->get(), | return Instance { descriptor->get()->instantiate (descriptor->get(), | ||||
| pluginUri.toString (false).toRawUTF8(), | |||||
| File::addTrailingSeparator (bundlePath.getFullPathName()).toRawUTF8(), | |||||
| args.pluginUri.toString (true).toRawUTF8(), | |||||
| File::addTrailingSeparator (args.bundlePath.getFullPathName()).toRawUTF8(), | |||||
| writeFunction, | writeFunction, | ||||
| this, | this, | ||||
| &widget, | &widget, | ||||