From 51bbeca095cc2ff440c62971edd2da4f51300665 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 27 Aug 2014 00:44:57 +0100 Subject: [PATCH] Fix LV2 discovery on Windows --- source/discovery/carla-discovery.cpp | 11 ++++++----- source/modules/lilv/lilv-0.20.0/lilv/lilvmm.hpp | 3 +++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/discovery/carla-discovery.cpp b/source/discovery/carla-discovery.cpp index 673871338..1cdba0763 100644 --- a/source/discovery/carla-discovery.cpp +++ b/source/discovery/carla-discovery.cpp @@ -940,12 +940,13 @@ static void do_lv2_check(const char* const bundle, const bool doInit) { Lv2WorldClass& lv2World(Lv2WorldClass::getInstance()); - // Convert bundle filename to URI - CarlaString sBundle("file://"); - sBundle += bundle; + Lilv::Node bundleNode(lv2World.new_file_uri(nullptr, bundle)); + CARLA_SAFE_ASSERT_RETURN(bundleNode.is_uri(),); - if (! sBundle.endsWith(CARLA_OS_SEP)) - sBundle += CARLA_OS_SEP_STR; + CarlaString sBundle(bundleNode.as_uri()); + + if (! sBundle.endsWith("/")) + sBundle += "/"; // Load bundle lv2World.load_bundle(sBundle); diff --git a/source/modules/lilv/lilv-0.20.0/lilv/lilvmm.hpp b/source/modules/lilv/lilv-0.20.0/lilv/lilvmm.hpp index 0d82f3f1b..6d0f80ac3 100644 --- a/source/modules/lilv/lilv-0.20.0/lilv/lilvmm.hpp +++ b/source/modules/lilv/lilv-0.20.0/lilv/lilvmm.hpp @@ -322,6 +322,9 @@ struct World { inline LilvNode* new_uri(const char* uri) const { return lilv_new_uri(me, uri); } + inline LilvNode* new_file_uri(const char* host, const char* path) const { + return lilv_new_file_uri(me, host, path); + } inline LilvNode* new_string(const char* str) const { return lilv_new_string(me, str); }