From 8528011e19f061258f1723645d7202305b529f0e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Feb 2008 01:42:50 +0000 Subject: Update Swig/Python bindings. git-svn-id: http://svn.drobilla.net/lad/slv2@1145 a436a847-0d15-0410-975c-d299462d15a1 --- swig/slv2.i | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'swig/slv2.i') diff --git a/swig/slv2.i b/swig/slv2.i index 5020767..593411e 100644 --- a/swig/slv2.i +++ b/swig/slv2.i @@ -41,8 +41,15 @@ typedef struct { SLV2Plugin me; } Plugin; free($self); } - char* name() { return slv2_plugin_get_name($self->me); } - const char* uri() { return slv2_plugin_get_uri($self->me); } + char* name() { + SLV2Value nm = slv2_plugin_get_name($self->me); + char* ret = nm ? strdup((char*)slv2_value_as_string(nm)) : strdup(""); + slv2_value_free(nm); + return ret; + } + const char* uri() { + return strdup((char*)slv2_value_as_string(slv2_plugin_get_uri($self->me))); + } }; typedef struct { SLV2World world; SLV2Plugins me; } Plugins; @@ -101,8 +108,15 @@ typedef struct { SLV2World me; } World; } void load_all() { slv2_world_load_all($self->me); } - void load_bundle(const char* path) { slv2_world_load_bundle($self->me, path); } - Plugins* get_all_plugins() { return new_Plugins($self->me, slv2_world_get_all_plugins($self->me)); } + void load_bundle(const char* uri) { + SLV2Value bundle_uri = slv2_value_new_uri($self->me, (const unsigned char*)uri); + slv2_world_load_bundle($self->me, bundle_uri); + slv2_value_free(bundle_uri); + } + + Plugins* get_all_plugins() { + return new_Plugins($self->me, slv2_world_get_all_plugins($self->me)); + } }; -- cgit v1.2.1