2 Copyright (C) 2008-2010 Paul Davis
3 Author: David Robillard
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include "ardour/uri_map.h"
34 uri_map_feature_data.uri_to_id = &URIMap::uri_map_uri_to_id;
35 uri_map_feature_data.callback_data = this;
36 uri_map_feature.URI = LV2_URI_MAP_URI;
37 uri_map_feature.data = &uri_map_feature_data;
42 URIMap::uri_to_id(const char* map,
45 return uri_map_uri_to_id(this, map, uri);
50 URIMap::uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data,
54 // TODO: map ignored, < UINT16_MAX assumed
56 URIMap* me = (URIMap*)callback_data;
59 Map::iterator i = me->uri_map.find(uri);
60 if (i != me->uri_map.end()) {
63 ret = me->next_uri_id++;
64 me->uri_map.insert(make_pair(string(uri), ret));
67 /*cout << "URI MAP (" << (map ? (void*)map : NULL)
68 << "): " << uri << " -> " << ret << endl;*/
70 assert(ret <= UINT16_MAX);