}
}
+#ifdef LV2_EXTENDED
+/* inline display extension */
+static void
+queue_draw (LV2_Inline_Display_Handle handle)
+{
+ LV2Plugin* plugin = (LV2Plugin*)handle;
+ plugin->QueueDraw(); /* EMIT SIGNAL */
+}
+#endif
+
/* log extension */
static int
, block_length(0)
#ifdef HAVE_LV2_1_2_0
, options(0)
+#endif
+#ifdef LV2_EXTENDED
+ , queue_draw(0)
#endif
{}
#ifdef HAVE_LV2_1_2_0
LV2_Options_Option* options;
#endif
+#ifdef LV2_EXTENDED
+ LV2_Inline_Display* queue_draw;
+#endif
};
LV2Plugin::LV2Plugin (AudioEngine& engine,
lilv_node_free(state_uri);
lilv_node_free(state_iface_uri);
- _features = (LV2_Feature**)calloc(11, sizeof(LV2_Feature*));
+ _features = (LV2_Feature**)calloc(12, sizeof(LV2_Feature*));
_features[0] = &_instance_access_feature;
_features[1] = &_data_access_feature;
_features[2] = &_make_path_feature;
lv2_atom_forge_init(&_impl->forge, _uri_map.urid_map());
lv2_atom_forge_init(&_impl->ui_forge, _uri_map.urid_map());
+#ifdef LV2_EXTENDED
+ _impl->queue_draw = (LV2_Inline_Display*)
+ malloc (sizeof(LV2_Inline_Display));
+ _impl->queue_draw->handle = this;
+ _impl->queue_draw->queue_draw = queue_draw;
+
+ _queue_draw_feature.URI = LV2_INLINEDISPLAY__queue_draw;
+ _queue_draw_feature.data = _impl->queue_draw;
+ _features[n_features++] = &_queue_draw_feature;
+#endif
+
#ifdef HAVE_LV2_1_2_0
LV2_URID atom_Int = _uri_map.uri_to_id(LV2_ATOM__Int);
static const int32_t _min_block_length = 1; // may happen during split-cycles
lilv_node_free(options_iface_uri);
#endif
+#ifdef LV2_EXTENDED
+ _display_interface = (const LV2_Inline_Display_Interface*)
+ extension_data (LV2_INLINEDISPLAY__interface);
+#endif
+
if (lilv_plugin_has_feature(plugin, _world.lv2_inPlaceBroken)) {
error << string_compose(
_("LV2: \"%1\" cannot be used, since it cannot do inplace processing."),
#ifdef HAVE_LV2_1_2_0
free(_impl->options);
#endif
+#ifdef LV2_EXTENDED
+ free(_impl->queue_draw);
+#endif
free(_features);
free(_make_path_feature.data);
return !fs_matches && !nrs_matches;
}
+#ifdef LV2_EXTENDED
+bool
+LV2Plugin::has_inline_display () {
+ return _display_interface ? true : false;
+}
+
+Plugin::Display_Image_Surface*
+LV2Plugin::render_inline_display (uint32_t w, uint32_t h) {
+ if (_display_interface) {
+ /* Plugin::Display_Image_Surface is identical to
+ * LV2_Inline_Display_Image_Surface */
+ return (Plugin::Display_Image_Surface*) _display_interface->render ((void*)_impl->instance->lv2_handle, w, h);
+ }
+ return NULL;
+}
+#endif
+
string
LV2Plugin::unique_id() const
{
_uri_map.urids.patch_value, &value,
0);
- if (!property || !value ||
- property->type != _uri_map.urids.atom_URID ||
- value->type != _uri_map.urids.atom_Path) {
+ if (property && value &&
+ property->type == _uri_map.urids.atom_URID &&
+ value->type == _uri_map.urids.atom_Path) {
+ const uint32_t prop_id = ((const LV2_Atom_URID*)property)->body;
+ const char* path = (const char*)LV2_ATOM_BODY_CONST(value);
+
+ // Emit PropertyChanged signal for UI
+ // TODO: This should emit the control's Changed signal
+ PropertyChanged(prop_id, Variant(Variant::PATH, path));
+ } else {
std::cerr << "warning: patch:Set for unknown property" << std::endl;
- continue;
}
-
- const uint32_t prop_id = ((const LV2_Atom_URID*)property)->body;
- const char* path = (const char*)LV2_ATOM_BODY_CONST(value);
-
- // Emit PropertyChanged signal for UI
- // TODO: This should emit the control's Changed signal
- PropertyChanged(prop_id, Variant(Variant::PATH, path));
}
}
}