diff options
author | David Robillard <d@drobilla.net> | 2015-09-04 22:28:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-09-04 22:28:28 +0000 |
commit | 183195508e8f45bc571fac8955789e70570b8a1b (patch) | |
tree | ec9eb4ff7060b3b0beec0bebac2b26073e4189fd /src/server/events/Delta.cpp | |
parent | 9cfc41a86b30d4b10cffd5404c91ce852ab6a1a8 (diff) | |
download | ingen-183195508e8f45bc571fac8955789e70570b8a1b.tar.gz ingen-183195508e8f45bc571fac8955789e70570b8a1b.tar.bz2 ingen-183195508e8f45bc571fac8955789e70570b8a1b.zip |
Fix various atom conversion issues.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5719 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events/Delta.cpp')
-rw-r--r-- | src/server/events/Delta.cpp | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/src/server/events/Delta.cpp b/src/server/events/Delta.cpp index a768beb0..a85c8253 100644 --- a/src/server/events/Delta.cpp +++ b/src/server/events/Delta.cpp @@ -17,6 +17,8 @@ #include <vector> #include <thread> +#include <glibmm/convert.h> + #include "ingen/Log.hpp" #include "ingen/Store.hpp" #include "ingen/URIs.hpp" @@ -290,22 +292,24 @@ Delta::pre_process() _status = Status::BAD_VALUE_TYPE; } } else if (key == uris.pset_preset) { - if (value.type() == uris.forge.URI) { - const char* str = value.ptr<char>(); - if (Raul::URI::is_valid(str)) { - op = SpecialType::PRESET; - const Raul::URI uri(str); - if ((_state = block->load_preset(Raul::URI(str)))) { - lilv_state_emit_port_values( - _state, s_add_set_event, this); - } else { - _engine.log().warn(fmt("Failed to load preset <%1%>\n") % str); - } + std::string uri_str; + if (uris.forge.is_uri(value)) { + uri_str = uris.forge.str(value, false); + } else if (value.type() == uris.forge.Path) { + uri_str = Glib::filename_to_uri(value.ptr<char>()); + } + + if (Raul::URI::is_valid(uri_str)) { + const Raul::URI uri(uri_str); + op = SpecialType::PRESET; + if ((_state = block->load_preset(uri))) { + lilv_state_emit_port_values( + _state, s_add_set_event, this); } else { - _status = Status::BAD_VALUE; + _engine.log().warn(fmt("Failed to load preset <%1%>\n") % uri); } } else { - _status = Status::BAD_VALUE_TYPE; + _status = Status::BAD_VALUE; } } } |