diff options
Diffstat (limited to 'pluginlv2.h')
-rw-r--r-- | pluginlv2.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/pluginlv2.h b/pluginlv2.h index da10ac3..ee80f7a 100644 --- a/pluginlv2.h +++ b/pluginlv2.h @@ -35,6 +35,12 @@ #include <lv2/lv2plug.in/ns/ext/dynmanifest/dynmanifest.h> #include <lv2/lv2plug.in/ns/extensions/ui/ui.h> +#define DISPLAY_INTERFACE + +#ifdef DISPLAY_INTERFACE +#include "inline-display.h" +#endif + enum class LV2Ports { FreeWheel = 0, @@ -126,6 +132,25 @@ public: std::size_t count) = 0; // + // Inline GUI (optional) + // + + //! Return true if a GUI implementation is to be used. + virtual bool hasInlineGUI() + { + return false; + } + + //! Render call back. + //! \param width The client area width as specified by the host. + //! \param max_height The maximum allowed clieant area height as specified + //! by the host. + //! \param context The render context filled an maintained by the plugin. + virtual void onInlineRedraw(std::size_t width, + std::size_t max_height, + InlineDrawContext& context) {} + + // // GUI (optional) // @@ -220,6 +245,17 @@ private: LV2_URID_Map* map{nullptr}; +#ifdef DISPLAY_INTERFACE + LV2_Inline_Display_Image_Surface surf; + LV2_Inline_Display* queue_draw{nullptr}; + + InlineDrawContext drawContext; + + static LV2_Inline_Display_Image_Surface *inlineRender(LV2_Handle instance, + uint32_t w, + uint32_t max_h); +#endif + bool active{false}; // |