36 #ifndef LVTK_URIMAP_HPP 37 #define LVTK_URIMAP_HPP 39 #include <lv2/lv2plug.in/ns/ext/uri-map/uri-map.h> 40 #include <lvtk/private/types.hpp> 42 #warning "this header uses the deprecated lv2 extension uri-map. \ 43 please use URID instead." 55 template<
bool Required = true>
58 template<
class Derived>
59 struct I : Extension<Required>
62 I() : m_callback_data(0), m_func(0)
77 Derived* d =
reinterpret_cast<Derived*
>(instance);
79 LV2_URI_Map_Feature* umf =
80 reinterpret_cast<LV2_URI_Map_Feature*
>(data);
81 fe->m_callback_data = umf->callback_data;
83 fe->m_ok = (fe->m_func != 0);
92 std::clog <<
" [LV2::URIMap] Validation " 93 << (this->m_ok ?
"succeeded" :
"failed")
114 uint32_t result = m_func(m_callback_data, map, uri);
115 std::clog <<
"[LV2::URIMap] uri_to_id(\"" << uri
116 <<
"\") -> " << result << std::endl;
119 return m_func(m_callback_data, map, uri);
122 LV2_URI_Map_Callback_Data m_callback_data;
123 uint32_t (*m_func)(LV2_URI_Map_Callback_Data,
const char*,
const char*);
Definition: urimap.hpp:59
static void handle_feature(void *instance, void *data)
Definition: urimap.hpp:75
bool check_ok()
Definition: urimap.hpp:88
Definition: feature.hpp:34
Definition: urimap.hpp:56
uint32_t uri_to_id(const char *map, const char *uri) const
Definition: urimap.hpp:110
static void map_feature_handlers(FeatureHandlerMap &hmap)
Definition: urimap.hpp:68
map< string, FeatureHandler > FeatureHandlerMap
Definition: feature.hpp:57