+void
+LV2PluginUI::write_to_ui(void* controller,
+ uint32_t port_index,
+ uint32_t buffer_size,
+ uint32_t format,
+ const void* buffer)
+{
+ LV2PluginUI* me = (LV2PluginUI*)controller;
+ if (me->_inst) {
+ suil_instance_port_event((SuilInstance*)me->_inst,
+ port_index, buffer_size, format, buffer);
+ }
+}
+
+uint32_t
+LV2PluginUI::port_index(void* controller, const char* symbol)
+{
+ return ((LV2PluginUI*)controller)->_lv2->port_index(symbol);
+}
+
+void
+LV2PluginUI::touch(void* controller,
+ uint32_t port_index,
+ bool grabbed)
+{
+ LV2PluginUI* me = (LV2PluginUI*)controller;
+ if (port_index >= me->_controllables.size()) {
+ return;
+ }
+
+ ControllableRef control = me->_controllables[port_index];
+ if (grabbed) {
+ control->start_touch(control->session().transport_frame());
+ } else {
+ control->stop_touch(false, control->session().transport_frame());
+ }
+}
+
+void
+LV2PluginUI::update_timeout()
+{
+ _lv2->emit_to_ui(this, &LV2PluginUI::write_to_ui);
+}
+