1 /* This file is part of Ingen.
2 * Copyright (C) 2008 Dave Robillard <http://drobilla.net>
4 * Ingen is free software; you can redistribute it and/or modify it under the
5 * terms of the GNU General Public License as published by the Free Software
6 * Foundation; either version 2 of the License, or (at your option) any later
9 * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
10 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
13 * You should have received a copy of the GNU General Public License along
14 * with this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 #define __STDC_LIMIT_MACROS 1
22 #include "ardour/uri_map.h"
32 uri_map_feature_data.uri_to_id = &URIMap::uri_map_uri_to_id;
33 uri_map_feature_data.callback_data = this;
34 uri_map_feature.URI = LV2_URI_MAP_URI;
35 uri_map_feature.data = &uri_map_feature_data;
40 URIMap::uri_to_id(const char* map,
43 return uri_map_uri_to_id(this, map, uri);
48 URIMap::uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data,
52 // TODO: map ignored, < UINT16_MAX assumed
54 URIMap* me = (URIMap*)callback_data;
57 Map::iterator i = me->uri_map.find(uri);
58 if (i != me->uri_map.end()) {
61 ret = me->next_uri_id++;
62 me->uri_map.insert(make_pair(string(uri), ret));
65 /*cout << "URI MAP (" << (map ? (void*)map : NULL)
66 << "): " << uri << " -> " << ret << endl;*/
68 assert(ret <= UINT16_MAX);