diff options
author | David Robillard <d@drobilla.net> | 2010-11-30 23:42:58 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-11-30 23:42:58 +0000 |
commit | 5aed83d9271cd68f709a373a169a019f7725cfc5 (patch) | |
tree | 64c2bb49a7ee897196d438e02467eacdcc08081d /libs/ardour/ardour/uri_map.h | |
parent | ce1492240ed8e2c157118e91c0483d2e056a5637 (diff) |
Correctly implement LV2 event URI mapping (event URI context is restricted to uint16_t).
Implement LV2 URI Unmap extension.
git-svn-id: svn://localhost/ardour2/branches/3.0@8139 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/ardour/uri_map.h')
-rw-r--r-- | libs/ardour/ardour/uri_map.h | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/libs/ardour/ardour/uri_map.h b/libs/ardour/ardour/uri_map.h index 59de9b3dfd..d75836e619 100644 --- a/libs/ardour/ardour/uri_map.h +++ b/libs/ardour/ardour/uri_map.h @@ -23,9 +23,12 @@ #include <map> #include <string> + #include <boost/utility.hpp> -#include <slv2/slv2.h> + +#include "lv2.h" #include "lv2ext/lv2_uri_map.h" +#include "lv2ext/lv2_uri_unmap.h" namespace ARDOUR { @@ -41,17 +44,28 @@ public: uint32_t uri_to_id(const char* map, const char* uri); -private: - typedef std::map<std::string, uint32_t> Map; + const char* id_to_uri(const char* map, + uint32_t id); +private: 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; - Map uri_map; - uint32_t next_uri_id; + static const char* uri_unmap_id_to_uri(LV2_URI_Map_Callback_Data callback_data, + const char* map, + const uint32_t id); + + typedef std::map<uint16_t, uint32_t> EventToGlobal; + typedef std::map<uint32_t, uint16_t> GlobalToEvent; + + EventToGlobal _event_to_global; + GlobalToEvent _global_to_event; + + LV2_Feature uri_map_feature; + LV2_URI_Map_Feature uri_map_feature_data; + LV2_Feature uri_unmap_feature; + LV2_URI_Unmap_Feature uri_unmap_feature_data; }; |