diff options
author | David Robillard <d@drobilla.net> | 2008-07-28 21:56:03 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-07-28 21:56:03 +0000 |
commit | a6fb6a0289ea47692d87f3e0200532a426f8e60d (patch) | |
tree | 0e497255eb8a263ff9cca87b2ed125b71144cacb /src/libs/shared | |
parent | 8e2ba26101828dcf310e0a43ace7aa68dafd3b16 (diff) | |
download | ingen-a6fb6a0289ea47692d87f3e0200532a426f8e60d.tar.gz ingen-a6fb6a0289ea47692d87f3e0200532a426f8e60d.tar.bz2 ingen-a6fb6a0289ea47692d87f3e0200532a426f8e60d.zip |
Simply global memory management crap by using shared_ptr in the World struct (it's not C anyway, might as well).
Properly support LV2 events from plugin UIs over OSC and directly (w/ monolithic UI/engine).
Fix crashes on node destruction with monolithic UI/engine.
Resolves ticket #177.
git-svn-id: http://svn.drobilla.net/lad/ingen@1293 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/shared')
-rw-r--r-- | src/libs/shared/LV2Features.cpp | 2 | ||||
-rw-r--r-- | src/libs/shared/LV2URIMap.cpp | 11 | ||||
-rw-r--r-- | src/libs/shared/LV2URIMap.hpp | 19 | ||||
-rw-r--r-- | src/libs/shared/Makefile.am | 2 |
4 files changed, 25 insertions, 9 deletions
diff --git a/src/libs/shared/LV2Features.cpp b/src/libs/shared/LV2Features.cpp index 7b57d209..2e7eb10e 100644 --- a/src/libs/shared/LV2Features.cpp +++ b/src/libs/shared/LV2Features.cpp @@ -31,7 +31,7 @@ LV2Features::LV2Features() _lv2_features[0] = NULL; LV2URIMap* controller = new LV2URIMap(); - add_feature(LV2_URI_MAP_URI, &controller->uri_map_feature, controller); + add_feature(LV2_URI_MAP_URI, controller->feature(), controller); } diff --git a/src/libs/shared/LV2URIMap.cpp b/src/libs/shared/LV2URIMap.cpp index 3c38886f..c01dfea0 100644 --- a/src/libs/shared/LV2URIMap.cpp +++ b/src/libs/shared/LV2URIMap.cpp @@ -36,6 +36,14 @@ LV2URIMap::LV2URIMap() uri_map_feature.data = &uri_map_feature_data; } + +uint32_t +LV2URIMap::uri_to_id(const char* map, + const char* uri) +{ + return uri_map_uri_to_id(this, map, uri); +} + uint32_t LV2URIMap::uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data, @@ -55,7 +63,8 @@ LV2URIMap::uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data, me->uri_map.insert(make_pair(string(uri), ret)); } - cout << "URI MAP (" << map << "): " << uri << " -> " << ret << endl; + /*cout << "URI MAP (" << (map ? (void*)map : NULL) + << "): " << uri << " -> " << ret << endl;*/ assert(ret <= UINT16_MAX); return ret; diff --git a/src/libs/shared/LV2URIMap.hpp b/src/libs/shared/LV2URIMap.hpp index 0c947560..35130066 100644 --- a/src/libs/shared/LV2URIMap.hpp +++ b/src/libs/shared/LV2URIMap.hpp @@ -25,6 +25,7 @@ #include <map> #include <string> +#include <boost/utility.hpp> #include <slv2/slv2.h> #include "common/lv2ext/lv2_uri_map.h" @@ -32,22 +33,28 @@ namespace Ingen { namespace Shared { -/** Stuff that may need to be passed to an LV2 plugin (i.e. LV2 features). +/** Implementation of the LV2 URI Map extension */ -class LV2URIMap { +class LV2URIMap : public boost::noncopyable { public: LV2URIMap(); + + LV2_Feature* feature() { return &uri_map_feature; } + + uint32_t uri_to_id(const char* map, + const char* uri); +private: typedef std::map<std::string, uint32_t> URIMap; + static uint32_t uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data, + const char* map, + const char* uri); + LV2_Feature uri_map_feature; LV2_URI_Map_Feature uri_map_feature_data; URIMap uri_map; uint32_t next_uri_id; - - static uint32_t uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data, - const char* map, - const char* uri); }; diff --git a/src/libs/shared/Makefile.am b/src/libs/shared/Makefile.am index 4b7c62d4..e6cbee60 100644 --- a/src/libs/shared/Makefile.am +++ b/src/libs/shared/Makefile.am @@ -1,6 +1,6 @@ noinst_LTLIBRARIES = libingen_shared.la -libingen_shared_la_CXXFLAGS = @INGEN_CFLAGS@ @REDLANDMM_CFLAGS@ +libingen_shared_la_CXXFLAGS = @INGEN_CFLAGS@ @REDLANDMM_CFLAGS@ @SLV2_CFLAGS@ libingen_shared_la_SOURCES = \ LV2Features.hpp \ |