From a99b72e4adbc4c28fadc08d29299d99405f72db9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 21 Jan 2018 00:41:34 +0100 Subject: Add FilePath class and remove use of glib path utilities --- src/server/events/CreateBlock.cpp | 3 ++- src/server/events/Delta.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/server/events') diff --git a/src/server/events/CreateBlock.cpp b/src/server/events/CreateBlock.cpp index fc0c0f5e..d678bea3 100644 --- a/src/server/events/CreateBlock.cpp +++ b/src/server/events/CreateBlock.cpp @@ -119,7 +119,8 @@ CreateBlock::pre_process(PreProcessContext& ctx) LilvState* state = nullptr; auto s = _properties.find(uris.state_state); if (s != _properties.end() && s->second.type() == uris.forge.Path) { - state = LV2Block::load_state(_engine.world(), s->second.ptr()); + state = LV2Block::load_state( + _engine.world(), FilePath(s->second.ptr())); } // Instantiate plugin diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index 56cc22aa..b23ae884 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -17,8 +17,6 @@ #include #include -#include - #include "ingen/Log.hpp" #include "ingen/Store.hpp" #include "ingen/URIs.hpp" @@ -366,15 +364,17 @@ Delta::pre_process(PreProcessContext& ctx) _status = Status::BAD_VALUE_TYPE; } } else if (key == uris.pset_preset) { - std::string uri_str; + URI uri; if (uris.forge.is_uri(value)) { - uri_str = uris.forge.str(value, false); + const std::string uri_str = uris.forge.str(value, false); + if (URI::is_valid(uri_str)) { + uri = URI(uri_str); + } } else if (value.type() == uris.forge.Path) { - uri_str = Glib::filename_to_uri(value.ptr()); + uri = URI(FilePath(value.ptr())); } - if (URI::is_valid(uri_str)) { - const URI uri(uri_str); + if (!uri.empty()) { op = SpecialType::PRESET; if ((_state = block->load_preset(uri))) { lilv_state_emit_port_values( -- cgit v1.2.1