diff --git a/ext/lv2/README b/ext/lv2/README index 770c10d0f9..f3abb3c184 100644 --- a/ext/lv2/README +++ b/ext/lv2/README @@ -12,7 +12,8 @@ http://lv2plug.in/ns/lv2core http://lv2plug.in/ns/ext/port-groups and these host features: -http://lv2plug.in/ns/ext/log/ +http://lv2plug.in/ns/ext/log +http://lv2plug.in/ns/ext/urid Example Pipeline: @@ -38,6 +39,8 @@ TODO - we should sync, then fill the buffer and connect the port * support presets * support more host features + GST_DEBUG="lv2:4" GST_DEBUG_FILE=/tmp/gst.log gst-inspect lv2 + grep -o "needs host feature: .*$" /tmp/gst.log | sort | uniq -c | sort -n * samples sources: http://svn.drobilla.net/lad/trunk/lilv/utils/lv2info.c diff --git a/ext/lv2/gstlv2utils.c b/ext/lv2/gstlv2utils.c index 638aef34ee..7b841eddf1 100644 --- a/ext/lv2/gstlv2utils.c +++ b/ext/lv2/gstlv2utils.c @@ -28,6 +28,7 @@ #include "gstlv2utils.h" #include +#include GST_DEBUG_CATEGORY_EXTERN (lv2_debug); #define GST_CAT_DEFAULT lv2_debug @@ -56,16 +57,43 @@ lv2_log_vprintf (LV2_Log_Handle handle, LV2_URID type, } static LV2_Log_Log lv2_log = { - NULL, /* handle */ - lv2_log_printf, lv2_log_vprintf, + /* handle = */ NULL, lv2_log_printf, lv2_log_vprintf }; + static const LV2_Feature lv2_log_feature = { LV2_LOG__log, &lv2_log }; +/* - urid map/unmap extension */ + +static LV2_URID +lv2_urid_map (LV2_URID_Map_Handle handle, const char *uri) +{ + return (LV2_URID) g_quark_from_string (uri); +} + +static const char * +lv2_urid_unmap (LV2_URID_Unmap_Handle handle, LV2_URID urid) +{ + return g_quark_to_string ((GQuark) urid); +} + +static LV2_URID_Map lv2_map = { + /* handle = */ NULL, lv2_urid_map +}; + +static LV2_URID_Unmap lv2_unmap = { + /* handle = */ NULL, lv2_urid_unmap +}; + +static const LV2_Feature lv2_map_feature = { LV2_URID__map, &lv2_map }; +static const LV2_Feature lv2_unmap_feature = { LV2_URID__unmap, &lv2_unmap }; + /* feature list */ static const LV2_Feature *lv2_features[] = { &lv2_log_feature, + &lv2_map_feature, + &lv2_unmap_feature, NULL };