summaryrefslogtreecommitdiffstats
path: root/src/gui/NodeMenu.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-28 22:14:04 +0000
committerDavid Robillard <d@drobilla.net>2011-04-28 22:14:04 +0000
commit77d22f06129e91f51e37c09c71c0917a0136dd7d (patch)
tree5ec6cfac6d5a3d2c474ff636bb025bb2ea231cad /src/gui/NodeMenu.cpp
parenta6ba3fee281389ad8dbf2cceaa9a953495adb6e8 (diff)
downloadingen-77d22f06129e91f51e37c09c71c0917a0136dd7d.tar.gz
ingen-77d22f06129e91f51e37c09c71c0917a0136dd7d.tar.bz2
ingen-77d22f06129e91f51e37c09c71c0917a0136dd7d.zip
Switch to Lilv from SLV2.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3220 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui/NodeMenu.cpp')
-rw-r--r--src/gui/NodeMenu.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/gui/NodeMenu.cpp b/src/gui/NodeMenu.cpp
index e89f0d41..0c5c88fb 100644
--- a/src/gui/NodeMenu.cpp
+++ b/src/gui/NodeMenu.cpp
@@ -84,38 +84,38 @@ NodeMenu::init(SharedPtr<NodeModel> node)
_embed_gui_menuitem->hide();
}
-#ifdef HAVE_SLV2
+#ifdef HAVE_LILV
if (plugin && plugin->type() == PluginModel::LV2) {
- SLV2Value preset_pred = slv2_value_new_uri(
- plugin->slv2_world(),
+ LilvValue preset_pred = lilv_value_new_uri(
+ plugin->lilv_world(),
"http://lv2plug.in/ns/dev/presets#hasPreset");
- SLV2Value title_pred = slv2_value_new_uri(
- plugin->slv2_world(),
+ LilvValue title_pred = lilv_value_new_uri(
+ plugin->lilv_world(),
"http://dublincore.org/documents/dcmi-namespace/title");
- SLV2Values presets = slv2_plugin_get_value(
- plugin->slv2_plugin(), preset_pred);
+ LilvValues presets = lilv_plugin_get_value(
+ plugin->lilv_plugin(), preset_pred);
if (presets) {
_presets_menu = Gtk::manage(new Gtk::Menu());
- SLV2_FOREACH(values, i, presets) {
- SLV2Value uri = slv2_values_get(presets, i);
- SLV2Values titles = slv2_plugin_get_value_for_subject(
- plugin->slv2_plugin(), uri, title_pred);
+ LILV_FOREACH(values, i, presets) {
+ LilvValue uri = lilv_values_get(presets, i);
+ LilvValues titles = lilv_plugin_get_value_for_subject(
+ plugin->lilv_plugin(), uri, title_pred);
if (titles) {
- SLV2Value title = slv2_values_get_first(titles);
+ LilvValue title = lilv_values_get_first(titles);
_presets_menu->items().push_back(
Gtk::Menu_Helpers::MenuElem(
- slv2_value_as_string(title),
+ lilv_value_as_string(title),
sigc::bind(
sigc::mem_fun(this, &NodeMenu::on_preset_activated),
- string(slv2_value_as_string(uri)))));
+ string(lilv_value_as_string(uri)))));
// I have no idea why this is necessary, signal_activated doesn't work
// in this menu (and only this menu)
Gtk::MenuItem* item = &(_presets_menu->items().back());
item->signal_button_release_event().connect(
sigc::bind<0>(sigc::mem_fun(this, &NodeMenu::on_preset_clicked),
- string(slv2_value_as_string(uri))));
+ string(lilv_value_as_string(uri))));
}
}
items().push_front(Gtk::Menu_Helpers::SeparatorElem());
@@ -124,9 +124,9 @@ NodeMenu::init(SharedPtr<NodeModel> node)
Gtk::MenuItem* presets_menu_item = &(items().front());
presets_menu_item->set_submenu(*_presets_menu);
}
- slv2_values_free(presets);
- slv2_value_free(title_pred);
- slv2_value_free(preset_pred);
+ lilv_values_free(presets);
+ lilv_value_free(title_pred);
+ lilv_value_free(preset_pred);
}
#endif
@@ -178,45 +178,45 @@ NodeMenu::on_menu_disconnect()
void
NodeMenu::on_preset_activated(const std::string& uri)
{
-#ifdef HAVE_SLV2
+#ifdef HAVE_LILV
const NodeModel* const node = (NodeModel*)_object.get();
const PluginModel* const plugin = dynamic_cast<const PluginModel*>(node->plugin());
- SLV2Value port_pred = slv2_value_new_uri(
- plugin->slv2_world(),
+ LilvValue port_pred = lilv_value_new_uri(
+ plugin->lilv_world(),
"http://lv2plug.in/ns/lv2core#port");
- SLV2Value symbol_pred = slv2_value_new_uri(
- plugin->slv2_world(),
+ LilvValue symbol_pred = lilv_value_new_uri(
+ plugin->lilv_world(),
"http://lv2plug.in/ns/lv2core#symbol");
- SLV2Value value_pred = slv2_value_new_uri(
- plugin->slv2_world(),
+ LilvValue value_pred = lilv_value_new_uri(
+ plugin->lilv_world(),
"http://lv2plug.in/ns/ext/presets#value");
- SLV2Value subject = slv2_value_new_uri(plugin->slv2_world(), uri.c_str());
- SLV2Values ports = slv2_plugin_get_value_for_subject(
- plugin->slv2_plugin(),
+ LilvValue subject = lilv_value_new_uri(plugin->lilv_world(), uri.c_str());
+ LilvValues ports = lilv_plugin_get_value_for_subject(
+ plugin->lilv_plugin(),
subject,
port_pred);
App::instance().engine()->bundle_begin();
- SLV2_FOREACH(values, i, ports) {
- SLV2Value uri = slv2_values_get(ports, i);
- SLV2Values values = slv2_plugin_get_value_for_subject(
- plugin->slv2_plugin(), uri, value_pred);
- SLV2Values symbols = slv2_plugin_get_value_for_subject(
- plugin->slv2_plugin(), uri, symbol_pred);
+ LILV_FOREACH(values, i, ports) {
+ LilvValue uri = lilv_values_get(ports, i);
+ LilvValues values = lilv_plugin_get_value_for_subject(
+ plugin->lilv_plugin(), uri, value_pred);
+ LilvValues symbols = lilv_plugin_get_value_for_subject(
+ plugin->lilv_plugin(), uri, symbol_pred);
if (values && symbols) {
- SLV2Value val = slv2_values_get_first(values);
- SLV2Value sym = slv2_values_get_first(symbols);
+ LilvValue val = lilv_values_get_first(values);
+ LilvValue sym = lilv_values_get_first(symbols);
App::instance().engine()->set_property(
- node->path().base() + slv2_value_as_string(sym),
+ node->path().base() + lilv_value_as_string(sym),
App::instance().uris().ingen_value,
- slv2_value_as_float(val));
+ lilv_value_as_float(val));
}
}
App::instance().engine()->bundle_end();
- slv2_values_free(ports);
- slv2_value_free(value_pred);
- slv2_value_free(symbol_pred);
- slv2_value_free(port_pred);
+ lilv_values_free(ports);
+ lilv_value_free(value_pred);
+ lilv_value_free(symbol_pred);
+ lilv_value_free(port_pred);
#endif
}