From 5233941417f053a8d2e55b7720860e3778a21762 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 4 May 2011 18:35:25 +0000 Subject: Wrap get_by_uri collection methods. Fix lv2_apply.py up until run point. git-svn-id: http://svn.drobilla.net/lad/trunk/lilv@3251 a436a847-0d15-0410-975c-d299462d15a1 --- lilv/lilvmm.hpp | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) (limited to 'lilv/lilvmm.hpp') diff --git a/lilv/lilvmm.hpp b/lilv/lilvmm.hpp index 027d4c3..5123a42 100644 --- a/lilv/lilvmm.hpp +++ b/lilv/lilvmm.hpp @@ -105,21 +105,29 @@ struct PluginClass { }; #define LILV_WRAP_COLL(CT, ET, prefix) \ - struct CT { \ - inline CT(const Lilv ## CT* c_obj) : me(c_obj) {} \ - LILV_WRAP_CONVERSION(const Lilv ## CT); \ - LILV_WRAP0(unsigned, prefix, size); \ - LILV_WRAP1(const ET, prefix, get, LilvIter*, i); \ - LILV_WRAP0(LilvIter*, prefix, begin); \ - LILV_WRAP1(LilvIter*, prefix, next, LilvIter*, i); \ - LILV_WRAP1(bool, prefix, is_end, LilvIter*, i); \ - const Lilv ## CT* me; \ - }; \ - -LILV_WRAP_COLL(PluginClasses, PluginClass, plugin_classes); -LILV_WRAP_COLL(ScalePoints, ScalePoint, scale_points); -LILV_WRAP_COLL(Nodes, Node, nodes); + inline CT(const Lilv ## CT* c_obj) : me(c_obj) {} \ + LILV_WRAP_CONVERSION(const Lilv ## CT); \ + LILV_WRAP0(unsigned, prefix, size); \ + LILV_WRAP1(const ET, prefix, get, LilvIter*, i); \ + LILV_WRAP0(LilvIter*, prefix, begin); \ + LILV_WRAP1(LilvIter*, prefix, next, LilvIter*, i); \ + LILV_WRAP1(bool, prefix, is_end, LilvIter*, i); \ + const Lilv ## CT* me; \ + +struct PluginClasses { + LILV_WRAP_COLL(PluginClasses, PluginClass, plugin_classes); + LILV_WRAP1(const PluginClass, plugin_classes, get_by_uri, const LilvNode*, uri); +}; + +struct ScalePoints { + LILV_WRAP_COLL(ScalePoints, ScalePoint, scale_points); +}; +struct Nodes { + LILV_WRAP_COLL(Nodes, Node, nodes); + LILV_WRAP1(bool, nodes, contains, const Node, node); +}; + struct Port { inline Port(const LilvPlugin* p, const LilvPort* c_obj) : parent(p), me(c_obj) @@ -197,7 +205,10 @@ struct Plugin { const LilvPlugin* me; }; -LILV_WRAP_COLL(Plugins, Plugin, plugins); +struct Plugins { + LILV_WRAP_COLL(Plugins, Plugin, plugins); + LILV_WRAP1(const Plugin, plugins, get_by_uri, const LilvNode*, uri); +}; struct Instance { inline Instance(Plugin plugin, double sample_rate) { @@ -254,7 +265,7 @@ struct World { LILV_WRAP1_VOID(world, load_bundle, LilvNode*, bundle_uri); LILV_WRAP0(const LilvPluginClass*, world, get_plugin_class); LILV_WRAP0(const LilvPluginClasses*, world, get_plugin_classes); - LILV_WRAP0(Plugins, world, get_all_plugins); + LILV_WRAP0(const Plugins, world, get_all_plugins); LilvWorld* me; }; -- cgit v1.2.1