- }
- }
-
-#ifdef LV2_SUPPORT
- boost::shared_ptr<ARDOUR::LV2Plugin> lv2p = boost::dynamic_pointer_cast<LV2Plugin> (plugin);
- if (lv2p) {
- _fcb = (Gtk::FileChooserButton**) malloc(lv2p->patch_count() * sizeof(Gtk::FileChooserButton*));
- for (uint32_t p = 0; p < lv2p->patch_count(); ++p) {
- _fcb[p] = manage (new Gtk::FileChooserButton (Gtk::FILE_CHOOSER_ACTION_OPEN));
- _fcb[p]->signal_file_set().connect (sigc::bind(sigc::mem_fun (*this, &GenericPluginUI::patch_set_file), p));
- lv2p->PatchChanged.connect (*this, invalidator (*this), boost::bind (&GenericPluginUI::patch_changed, this, _1), gui_context());
- // when user cancels file selection the FileChooserButton will display "None"
- // TODO hack away around this..
- if (lv2p->patch_val(p)) {
- _fcb[p]->set_filename(lv2p->patch_val(p));
- }
- if (lv2p->patch_key(p)) {
- _fcb[p]->set_title(lv2p->patch_key(p));
- Gtk::Label* fcl = manage (new Label (lv2p->patch_key(p)));
- button_table.attach (*fcl, 0, button_cols, button_row, button_row + 1, FILL|EXPAND, FILL);
- ++button_row;
- } else {
- _fcb[p]->set_title(_("LV2 Patch"));
- }