+ control->stop_touch(control->session().transport_sample());
+ }
+}
+
+void
+LV2PluginUI::set_path_property (int response,
+ const ParameterDescriptor& desc,
+ Gtk::FileChooserDialog* widget)
+{
+ if (response == Gtk::RESPONSE_ACCEPT) {
+ plugin->set_property (desc.key, Variant (Variant::PATH, widget->get_filename()));
+ }
+#if 0
+ widget->hide ();
+ delete_when_idle (widget);
+#else
+ delete widget;
+#endif
+ active_parameter_requests.erase (desc.key);
+}
+
+uint32_t
+LV2PluginUI::request_parameter (void* handle, LV2_URID key)
+{
+ LV2PluginUI* me = (LV2PluginUI*)handle;
+
+ /* This will return `PropertyDescriptors nothing` when not found */
+ const ParameterDescriptor& desc (me->_lv2->get_property_descriptor(key));
+ if (desc.datatype != Variant::PATH) {
+ return 0;
+ }
+
+#if 0 // MODAL, blocking
+
+ Gtk::FileChooserDialog* lv2ui_file_dialog (desc.label, FILE_CHOOSER_ACTION_OPEN);
+ Gtkmm2ext::add_volume_shortcuts (lv2ui_file_dialog);
+ lv2ui_file_dialog.add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+ lv2ui_file_dialog.add_button (Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT);
+ lv2ui_file_dialog.set_default_response(Gtk::RESPONSE_ACCEPT);
+ if (_file_dialog.run()= Gtk::RESPONSE_ACCEPT) {
+ me->plugin->set_property (desc.key, Variant(Variant::PATH, lv2ui_file_dialog.get_filename()));
+ }
+ return 0;
+
+#else
+
+ if (me->active_parameter_requests.find (key) != me->active_parameter_requests.end()) {
+ return 0; /* already showing dialog */
+ }
+ me->active_parameter_requests.insert (key);
+
+ Gtk::FileChooserDialog* lv2ui_file_dialog = new Gtk::FileChooserDialog(desc.label, FILE_CHOOSER_ACTION_OPEN);
+ Gtkmm2ext::add_volume_shortcuts (*lv2ui_file_dialog);
+ lv2ui_file_dialog->add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+ lv2ui_file_dialog->add_button (Gtk::Stock::OPEN, Gtk::RESPONSE_ACCEPT);
+ lv2ui_file_dialog->set_default_response(Gtk::RESPONSE_ACCEPT);
+
+ /* this assumes announce_property_values() was called, or
+ * the plugin has previously sent a patch:Set */
+ const Variant& value = me->_lv2->get_property_value (desc.key);
+ if (value.type() == Variant::PATH) {
+ lv2ui_file_dialog->set_filename (value.get_path());