diff options
author | David Robillard <d@drobilla.net> | 2009-05-28 21:17:44 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-28 21:17:44 +0000 |
commit | c37080eae184227a74e5c96237d6e7bf398fbf16 (patch) | |
tree | f878e03d1176e19810ad22a3ffb61c1c69bda56d /src/gui | |
parent | 64a40ac2323cda14ecbce4e41618d6db32fd3573 (diff) | |
download | ingen-c37080eae184227a74e5c96237d6e7bf398fbf16.tar.gz ingen-c37080eae184227a74e5c96237d6e7bf398fbf16.tar.bz2 ingen-c37080eae184227a74e5c96237d6e7bf398fbf16.zip |
Fix LADSPA names in plugin selection dialog.
Fix request interface for non-graph objects (i.e. plugins).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2034 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/LoadPluginWindow.cpp | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 260641a9..70a0d5e3 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -220,16 +220,28 @@ LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin) _rows.insert(make_pair(plugin->uri(), iter)); const Atom& name = plugin->get_property("doap:name"); - if (name.is_valid() && name.type() == Atom::STRING) - row[_plugins_columns._col_name] = name.get_string(); - if (!strcmp(plugin->type_uri(), "ingen:Internal")) - row[_plugins_columns._col_type] = "Internal"; - else if (!strcmp(plugin->type_uri(), "lv2:Plugin")) + if (name.is_valid()) { + if (name.type() == Atom::STRING) + row[_plugins_columns._col_name] = name.get_string(); + } else if (plugin->type() == Plugin::LADSPA) { + App::instance().engine()->request_property(plugin->uri(), "doap:name"); + } + + switch (plugin->type()) { + case Plugin::LV2: row[_plugins_columns._col_type] = "LV2"; - else if (!strcmp(plugin->type_uri(), "ingen:LADSPAPlugin")) + break; + case Plugin::LADSPA: row[_plugins_columns._col_type] = "LADSPA"; - else - row[_plugins_columns._col_type] = plugin->type_uri(); + break; + case Plugin::Internal: + row[_plugins_columns._col_type] = "Internal"; + break; + case Plugin::Patch: + row[_plugins_columns._col_type] = "Patch"; + break; + } + row[_plugins_columns._col_uri] = plugin->uri().str(); row[_plugins_columns._col_plugin_model] = plugin; @@ -426,15 +438,17 @@ LoadPluginWindow::on_key_press_event(GdkEventKey* event) } } + void LoadPluginWindow::plugin_property_changed(const URI& plugin, const URI& predicate, const Atom& value) { - cerr << "PLUGIN PROPERTY " << plugin << " : " << predicate << " = " << value << endl; - Rows::const_iterator i = _rows.find(plugin); - if (i != _rows.end() && value.type() == Atom::STRING) - (*i->second)[_plugins_columns._col_name] = value.get_string(); + if (predicate.str() == "doap:name") { + Rows::const_iterator i = _rows.find(plugin); + if (i != _rows.end() && value.type() == Atom::STRING) + (*i->second)[_plugins_columns._col_name] = value.get_string(); + } } |