summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-26 15:27:03 +0000
committerDavid Robillard <d@drobilla.net>2012-07-26 15:27:03 +0000
commit3c5931bb13b5f88edcebb375fa6964dde8b85563 (patch)
tree9801897576b7fb9d8a9f700847c670f216fc93b7 /src/shared
parentb83ed4f83cf4c9b5054dcf55bea710313c369633 (diff)
downloadingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.tar.gz
ingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.tar.bz2
ingen-3c5931bb13b5f88edcebb375fa6964dde8b85563.zip
Report subject with errors to client for more meaningful error messages.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4556 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/AtomReader.cpp3
-rw-r--r--src/shared/AtomWriter.cpp6
-rw-r--r--src/shared/URIs.cpp1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/shared/AtomReader.cpp b/src/shared/AtomReader.cpp
index 2bdd9fe1..862c61b1 100644
--- a/src/shared/AtomReader.cpp
+++ b/src/shared/AtomReader.cpp
@@ -261,7 +261,8 @@ AtomReader::write(const LV2_Atom* msg)
return false;
}
_iface.response(((LV2_Atom_Int*)request)->body,
- (Ingen::Status)((LV2_Atom_Int*)body)->body);
+ (Ingen::Status)((LV2_Atom_Int*)body)->body,
+ subject_uri);
} else {
Raul::warn << "Unknown object type <"
<< _map.unmap_uri(obj->body.otype)
diff --git a/src/shared/AtomWriter.cpp b/src/shared/AtomWriter.cpp
index 7d600466..80bd0156 100644
--- a/src/shared/AtomWriter.cpp
+++ b/src/shared/AtomWriter.cpp
@@ -272,7 +272,7 @@ AtomWriter::get(const Raul::URI& uri)
}
void
-AtomWriter::response(int32_t id, Status status)
+AtomWriter::response(int32_t id, Status status, const std::string& subject)
{
if (id == -1) {
return;
@@ -282,6 +282,10 @@ AtomWriter::response(int32_t id, Status status)
lv2_atom_forge_blank(&_forge, &msg, next_id(), _uris.patch_Response);
lv2_atom_forge_property_head(&_forge, _uris.patch_request, 0);
lv2_atom_forge_int(&_forge, id);
+ if (!subject.empty() && Raul::URI::is_valid(subject)) {
+ lv2_atom_forge_property_head(&_forge, _uris.patch_subject, 0);
+ lv2_atom_forge_uri(&_forge, subject.c_str(), subject.length());
+ }
lv2_atom_forge_property_head(&_forge, _uris.patch_body, 0);
lv2_atom_forge_int(&_forge, status);
lv2_atom_forge_pop(&_forge, &msg);
diff --git a/src/shared/URIs.cpp b/src/shared/URIs.cpp
index b41a0db3..102c7b8b 100644
--- a/src/shared/URIs.cpp
+++ b/src/shared/URIs.cpp
@@ -75,6 +75,7 @@ URIs::URIs(Shared::Forge& f, URIMap* map)
, ingen_polyphony (forge, map, NS_INGEN "polyphony")
, ingen_prototype (forge, map, NS_INGEN "prototype")
, ingen_sampleRate (forge, map, NS_INGEN "sampleRate")
+ , ingen_status (forge, map, NS_INGEN "status")
, ingen_tail (forge, map, NS_INGEN "tail")
, ingen_uiEmbedded (forge, map, NS_INGEN "uiEmbedded")
, ingen_value (forge, map, NS_INGEN "value")