diff options
author | David Robillard <d@drobilla.net> | 2015-05-30 18:15:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2015-05-30 18:15:59 +0000 |
commit | d2760bc7ec7845b4e11966d035a91e863efc21e8 (patch) | |
tree | 7e4121e2d8335ea0a0714d2e2e1bf738ff163e75 /src/AtomReader.cpp | |
parent | ecdcc5f2c3d98a551ff8e5ae6b546704bf6aa881 (diff) | |
download | ingen-d2760bc7ec7845b4e11966d035a91e863efc21e8.tar.gz ingen-d2760bc7ec7845b4e11966d035a91e863efc21e8.tar.bz2 ingen-d2760bc7ec7845b4e11966d035a91e863efc21e8.zip |
Preliminary server-side save support.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5690 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/AtomReader.cpp')
-rw-r--r-- | src/AtomReader.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp index 28f511d6..c9f2f3ac 100644 --- a/src/AtomReader.cpp +++ b/src/AtomReader.cpp @@ -275,6 +275,32 @@ AtomReader::write(const LV2_Atom* msg) get_props(remove, remove_props); _iface.delta(*subject_uri, remove_props, add_props); + } else if (obj->body.otype == _uris.patch_Copy) { + if (!subject) { + _log.warn("Copy message has no subject\n"); + return false; + } + + const LV2_Atom* dest = NULL; + lv2_atom_object_get(obj, (LV2_URID)_uris.patch_destination, &dest, 0); + if (!dest) { + _log.warn("Copy message has no destination\n"); + return false; + } + + boost::optional<Raul::Path> subject_path(atom_to_path(subject)); + if (!subject_path) { + _log.warn("Copy message has non-path subject\n"); + return false; + } + + boost::optional<Raul::URI> dest_uri(atom_to_uri(dest)); + if (!dest_uri) { + _log.warn("Copy message has non-URI destination\n"); + return false; + } + + _iface.copy(*subject_path, *dest_uri); } else if (obj->body.otype == _uris.patch_Move) { if (!subject) { _log.warn("Move message has no subject\n"); |