+
+#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());
+ }
+
+#if 0 // TODO mime-type, file-extension filter, get from LV2 Parameter Property
+ FileFilter file_ext_filter;
+ file_ext_filter.add_pattern ("*.foo");
+ file_ext_filter.set_name ("Foo File");
+ lv2ui_file_dialog.add_filter (file_ext_filter);
+#endif
+
+ lv2ui_file_dialog->signal_response().connect (sigc::bind (sigc::mem_fun (*me, &LV2PluginUI::set_path_property), desc, lv2ui_file_dialog));
+ lv2ui_file_dialog->present();
+ return 0;
+
+#endif