| @@ -210,6 +210,11 @@ static constexpr const uint PLUGIN_HAS_CUSTOM_UI_USING_FILE_OPEN = 0x2000; | |||||
| */ | */ | ||||
| static constexpr const uint PLUGIN_NEEDS_MAIN_THREAD_IDLE = 0x4000; | static constexpr const uint PLUGIN_NEEDS_MAIN_THREAD_IDLE = 0x4000; | ||||
| /*! | |||||
| * Plugin has its own custom UI which is user resizable. | |||||
| */ | |||||
| static constexpr const uint PLUGIN_HAS_CUSTOM_RESIZABLE_UI = 0x8000; | |||||
| /** @} */ | /** @} */ | ||||
| /* ------------------------------------------------------------------------------------------------------------ | /* ------------------------------------------------------------------------------------------------------------ | ||||
| @@ -2193,7 +2193,7 @@ public: | |||||
| if (fBridgeVersion < 9 || fBinaryType == BINARY_WIN32 || fBinaryType == BINARY_WIN64) | if (fBridgeVersion < 9 || fBinaryType == BINARY_WIN32 || fBinaryType == BINARY_WIN64) | ||||
| #endif | #endif | ||||
| { | { | ||||
| pData->hints &= ~PLUGIN_HAS_CUSTOM_EMBED_UI; | |||||
| pData->hints &= ~(PLUGIN_HAS_CUSTOM_EMBED_UI|PLUGIN_HAS_CUSTOM_RESIZABLE_UI); | |||||
| } | } | ||||
| fInfo.category = static_cast<PluginCategory>(category); | fInfo.category = static_cast<PluginCategory>(category); | ||||
| @@ -1811,6 +1811,8 @@ public: | |||||
| pData->hints |= PLUGIN_HAS_CUSTOM_UI; | pData->hints |= PLUGIN_HAS_CUSTOM_UI; | ||||
| pData->hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | pData->hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | ||||
| pData->hints |= PLUGIN_NEEDS_UI_MAIN_THREAD; | pData->hints |= PLUGIN_NEEDS_UI_MAIN_THREAD; | ||||
| if (guiExt->can_resize(fPlugin)) | |||||
| pData->hints |= PLUGIN_HAS_CUSTOM_RESIZABLE_UI; | |||||
| } | } | ||||
| else if (guiExt->is_api_supported(fPlugin, CLAP_WINDOW_API_NATIVE, true)) | else if (guiExt->is_api_supported(fPlugin, CLAP_WINDOW_API_NATIVE, true)) | ||||
| { | { | ||||
| @@ -3315,7 +3315,18 @@ public: | |||||
| case LV2_UI_OLD_EXTERNAL: | case LV2_UI_OLD_EXTERNAL: | ||||
| break; | break; | ||||
| default: | default: | ||||
| pData->hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | |||||
| pData->hints |= PLUGIN_HAS_CUSTOM_EMBED_UI|PLUGIN_HAS_CUSTOM_RESIZABLE_UI; | |||||
| for (uint32_t i = 0; i < fUI.rdfDescriptor->ExtensionCount; ++i) | |||||
| { | |||||
| const char* const extension = fUI.rdfDescriptor->Extensions[i]; | |||||
| CARLA_SAFE_ASSERT_CONTINUE(extension != nullptr); | |||||
| if (std::strcmp(extension, LV2_UI__noUserResize) == 0) | |||||
| { | |||||
| pData->hints &= ~PLUGIN_HAS_CUSTOM_RESIZABLE_UI; | |||||
| break; | |||||
| } | |||||
| } | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| @@ -2319,6 +2319,8 @@ public: | |||||
| pData->hints |= PLUGIN_HAS_CUSTOM_UI; | pData->hints |= PLUGIN_HAS_CUSTOM_UI; | ||||
| pData->hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | pData->hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | ||||
| pData->hints |= PLUGIN_NEEDS_UI_MAIN_THREAD; | pData->hints |= PLUGIN_NEEDS_UI_MAIN_THREAD; | ||||
| if (v3_cpp_obj(fV3.view)->can_resize(fV3.view) == V3_TRUE) | |||||
| pData->hints |= PLUGIN_HAS_CUSTOM_RESIZABLE_UI; | |||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -262,15 +262,26 @@ static const CarlaCachedPluginInfo* get_cached_plugin_lv2(Lv2WorldClass& lv2Worl | |||||
| if (false) | if (false) | ||||
| #endif | #endif | ||||
| { | { | ||||
| info.hints |= CB::PLUGIN_HAS_CUSTOM_EMBED_UI; | |||||
| info.hints |= CB::PLUGIN_HAS_CUSTOM_EMBED_UI|CB::PLUGIN_HAS_CUSTOM_RESIZABLE_UI; | |||||
| Lilv::Nodes lilvSupportedFeatureNodes(lilvUI.get_supported_features()); | |||||
| LILV_FOREACH(nodes, it, lilvSupportedFeatureNodes) | |||||
| { | |||||
| Lilv::Node lilvFeatureNode(lilvSupportedFeatureNodes.get(it)); | |||||
| const char* const featureURI(lilvFeatureNode.as_uri()); | |||||
| CARLA_SAFE_ASSERT_CONTINUE(featureURI != nullptr); | |||||
| if (std::strcmp(featureURI, LV2_UI__noUserResize) == 0) | |||||
| { | |||||
| info.hints &= ~CB::PLUGIN_HAS_CUSTOM_RESIZABLE_UI; | |||||
| break; | |||||
| } | |||||
| } | |||||
| lilv_nodes_free(const_cast<LilvNodes*>(lilvSupportedFeatureNodes.me)); | |||||
| break; | break; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| #ifdef CARLA_OS_LINUX | |||||
| else if (lilvPlugin.get_modgui_resources_directory().as_uri() != nullptr) | |||||
| info.hints |= CB::PLUGIN_HAS_CUSTOM_UI; | |||||
| #endif | |||||
| lilv_nodes_free(const_cast<LilvNodes*>(lilvUIs.me)); | lilv_nodes_free(const_cast<LilvNodes*>(lilvUIs.me)); | ||||
| } | } | ||||
| @@ -1824,9 +1824,9 @@ static bool do_vst3_check(lib_t& libHandle, const char* const filename, const bo | |||||
| if (v3_cpp_obj(view)->is_platform_type_supported(view, V3_VIEW_PLATFORM_TYPE_NATIVE) == V3_TRUE) | if (v3_cpp_obj(view)->is_platform_type_supported(view, V3_VIEW_PLATFORM_TYPE_NATIVE) == V3_TRUE) | ||||
| { | { | ||||
| hints |= PLUGIN_HAS_CUSTOM_UI; | hints |= PLUGIN_HAS_CUSTOM_UI; | ||||
| #ifndef BUILD_BRIDGE | |||||
| hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | ||||
| #endif | |||||
| if (v3_cpp_obj(view)->can_resize(view) == V3_TRUE) | |||||
| hints |= PLUGIN_HAS_CUSTOM_RESIZABLE_UI; | |||||
| } | } | ||||
| v3_cpp_obj_unref(view); | v3_cpp_obj_unref(view); | ||||
| @@ -2634,10 +2634,12 @@ static bool do_clap_check(lib_t& libHandle, const char* const filename, const bo | |||||
| if (gui != nullptr) | if (gui != nullptr) | ||||
| { | { | ||||
| hints |= PLUGIN_HAS_CUSTOM_UI; | hints |= PLUGIN_HAS_CUSTOM_UI; | ||||
| #ifndef BUILD_BRIDGE | |||||
| if (gui->is_api_supported(plugin, CLAP_WINDOW_API_NATIVE, false)) | if (gui->is_api_supported(plugin, CLAP_WINDOW_API_NATIVE, false)) | ||||
| { | |||||
| hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | hints |= PLUGIN_HAS_CUSTOM_EMBED_UI; | ||||
| #endif | |||||
| if (gui->can_resize(plugin)) | |||||
| hints |= PLUGIN_HAS_CUSTOM_RESIZABLE_UI; | |||||
| } | |||||
| } | } | ||||
| #endif | #endif | ||||
| @@ -207,6 +207,21 @@ PLUGIN_USES_MULTI_PROGS = 0x400 | |||||
| # Plugin can make use of inline display API. | # Plugin can make use of inline display API. | ||||
| PLUGIN_HAS_INLINE_DISPLAY = 0x800 | PLUGIN_HAS_INLINE_DISPLAY = 0x800 | ||||
| # Plugin has its own custom UI which can be embed into another Window. | |||||
| # @see carla_embed_custom_ui() | |||||
| # @note This is very experimental and subject to change at this point | |||||
| PLUGIN_HAS_CUSTOM_EMBED_UI = 0x1000 | |||||
| # Plugin custom UI is a fake one that simply invokes an open file browser dialog. | |||||
| PLUGIN_HAS_CUSTOM_UI_USING_FILE_OPEN = 0x2000 | |||||
| # Plugin needs all idle events in the main thread. | |||||
| # @note Not possible on all engine implementations. | |||||
| PLUGIN_NEEDS_MAIN_THREAD_IDLE = 0x4000 | |||||
| # Plugin has its own custom UI which is user resizable. | |||||
| PLUGIN_HAS_CUSTOM_RESIZABLE_UI = 0x8000 | |||||
| # --------------------------------------------------------------------------------------------------------------------- | # --------------------------------------------------------------------------------------------------------------------- | ||||
| # Plugin Options | # Plugin Options | ||||
| # Various plugin options. | # Various plugin options. | ||||