mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
Indicate whether to show plugin's inline display in GUI
This is currently done by an extension data similarly to LV2_INLINEDISPLAY__interface.
This commit is contained in:
parent
59775df9be
commit
2716ce41e0
6 changed files with 20 additions and 2 deletions
|
|
@ -529,9 +529,8 @@ GenericPluginUI::automatic_layout (const std::vector<ControlUI*>& control_uis)
|
||||||
delete output_table;
|
delete output_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin->has_inline_display ()) {
|
if (plugin->has_inline_display () && plugin->inline_display_in_gui ()) {
|
||||||
PluginDisplay* pd = manage (new PluginDisplay (plugin, 300));
|
PluginDisplay* pd = manage (new PluginDisplay (plugin, 300));
|
||||||
pd->set_name("inside gui");
|
|
||||||
hpacker.pack_end (*pd, true, true);
|
hpacker.pack_end (*pd, true, true);
|
||||||
}
|
}
|
||||||
show_all();
|
show_all();
|
||||||
|
|
@ -551,6 +550,11 @@ GenericPluginUI::custom_layout (const std::vector<ControlUI*>& control_uis)
|
||||||
layout->attach (*cui, cui->x0, cui->x1, cui->y0, cui->y1, FILL, SHRINK, 2, 2);
|
layout->attach (*cui, cui->x0, cui->x1, cui->y0, cui->y1, FILL, SHRINK, 2, 2);
|
||||||
}
|
}
|
||||||
hpacker.pack_start (*layout, true, true);
|
hpacker.pack_start (*layout, true, true);
|
||||||
|
|
||||||
|
if (plugin->has_inline_display () && plugin->inline_display_in_gui ()) {
|
||||||
|
PluginDisplay* pd = manage (new PluginDisplay (plugin, 300));
|
||||||
|
hpacker.pack_end (*pd, true, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GenericPluginUI::ControlUI::ControlUI (const Evoral::Parameter& p)
|
GenericPluginUI::ControlUI::ControlUI (const Evoral::Parameter& p)
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@
|
||||||
#define LV2_INLINEDISPLAY_PREFIX LV2_INLINEDISPLAY_URI "#"
|
#define LV2_INLINEDISPLAY_PREFIX LV2_INLINEDISPLAY_URI "#"
|
||||||
#define LV2_INLINEDISPLAY__interface LV2_INLINEDISPLAY_PREFIX "interface"
|
#define LV2_INLINEDISPLAY__interface LV2_INLINEDISPLAY_PREFIX "interface"
|
||||||
#define LV2_INLINEDISPLAY__queue_draw LV2_INLINEDISPLAY_PREFIX "queue_draw"
|
#define LV2_INLINEDISPLAY__queue_draw LV2_INLINEDISPLAY_PREFIX "queue_draw"
|
||||||
|
#define LV2_INLINEDISPLAY__in_gui LV2_INLINEDISPLAY_PREFIX "in_gui"
|
||||||
|
|
||||||
/** Opaque handle for LV2_Inline_Display::queue_draw() */
|
/** Opaque handle for LV2_Inline_Display::queue_draw() */
|
||||||
typedef void* LV2_Inline_Display_Handle;
|
typedef void* LV2_Inline_Display_Handle;
|
||||||
|
|
|
||||||
|
|
@ -278,6 +278,7 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
|
||||||
|
|
||||||
#ifdef LV2_EXTENDED
|
#ifdef LV2_EXTENDED
|
||||||
const LV2_Inline_Display_Interface* _display_interface;
|
const LV2_Inline_Display_Interface* _display_interface;
|
||||||
|
bool _show_display_in_generic_gui;
|
||||||
const LV2_Midnam_Interface* _midname_interface;
|
const LV2_Midnam_Interface* _midname_interface;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
@ -322,6 +323,7 @@ class LIBARDOUR_API LV2Plugin : public ARDOUR::Plugin, public ARDOUR::Workee
|
||||||
|
|
||||||
#ifdef LV2_EXTENDED
|
#ifdef LV2_EXTENDED
|
||||||
bool has_inline_display ();
|
bool has_inline_display ();
|
||||||
|
bool inline_display_in_gui ();
|
||||||
Plugin::Display_Image_Surface* render_inline_display (uint32_t, uint32_t);
|
Plugin::Display_Image_Surface* render_inline_display (uint32_t, uint32_t);
|
||||||
|
|
||||||
bool has_midnam ();
|
bool has_midnam ();
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@ class LIBARDOUR_API Plugin : public PBD::StatefulDestructible, public Latent
|
||||||
} Display_Image_Surface;
|
} Display_Image_Surface;
|
||||||
|
|
||||||
virtual bool has_inline_display () { return false; }
|
virtual bool has_inline_display () { return false; }
|
||||||
|
virtual bool inline_display_in_gui () { return false; }
|
||||||
virtual Display_Image_Surface* render_inline_display (uint32_t, uint32_t) { return NULL; }
|
virtual Display_Image_Surface* render_inline_display (uint32_t, uint32_t) { return NULL; }
|
||||||
PBD::Signal0<void> QueueDraw;
|
PBD::Signal0<void> QueueDraw;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -547,6 +547,8 @@ LV2Plugin::init(const void* c_plugin, framecnt_t rate)
|
||||||
_display_interface = (const LV2_Inline_Display_Interface*)
|
_display_interface = (const LV2_Inline_Display_Interface*)
|
||||||
extension_data (LV2_INLINEDISPLAY__interface);
|
extension_data (LV2_INLINEDISPLAY__interface);
|
||||||
|
|
||||||
|
_show_display_in_generic_gui = (bool) extension_data (LV2_INLINEDISPLAY__in_gui);
|
||||||
|
|
||||||
_midname_interface = (const LV2_Midnam_Interface*)
|
_midname_interface = (const LV2_Midnam_Interface*)
|
||||||
extension_data (LV2_MIDNAM__interface);
|
extension_data (LV2_MIDNAM__interface);
|
||||||
if (_midname_interface) {
|
if (_midname_interface) {
|
||||||
|
|
@ -962,6 +964,11 @@ LV2Plugin::has_inline_display () {
|
||||||
return _display_interface ? true : false;
|
return _display_interface ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
LV2Plugin::inline_display_in_gui () {
|
||||||
|
return _show_display_in_generic_gui;
|
||||||
|
}
|
||||||
|
|
||||||
Plugin::Display_Image_Surface*
|
Plugin::Display_Image_Surface*
|
||||||
LV2Plugin::render_inline_display (uint32_t w, uint32_t h) {
|
LV2Plugin::render_inline_display (uint32_t w, uint32_t h) {
|
||||||
if (_display_interface) {
|
if (_display_interface) {
|
||||||
|
|
|
||||||
|
|
@ -873,6 +873,9 @@ extension_data(const char* uri)
|
||||||
if (!strcmp(uri, LV2_INLINEDISPLAY__interface)) {
|
if (!strcmp(uri, LV2_INLINEDISPLAY__interface)) {
|
||||||
return &display;
|
return &display;
|
||||||
}
|
}
|
||||||
|
if (!strcmp(uri, LV2_INLINEDISPLAY__in_gui)) {
|
||||||
|
return &display;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue