diff options
author | David Robillard <d@drobilla.net> | 2011-05-20 03:48:01 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-05-20 03:48:01 +0000 |
commit | 65f4c6021c03eb14084a1e6446185274fec751fe (patch) | |
tree | a952e0f3278f1e0af6262cea8fb7e931e0b88ff2 /src | |
parent | 4999a7199470ee751d710cfca2a39b4fdc561a82 (diff) | |
download | ingen-65f4c6021c03eb14084a1e6446185274fec751fe.tar.gz ingen-65f4c6021c03eb14084a1e6446185274fec751fe.tar.bz2 ingen-65f4c6021c03eb14084a1e6446185274fec751fe.zip |
Fix multiple put replies on port creation.
Include value in initial put response for control ports.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3296 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r-- | src/server/ObjectSender.cpp | 14 | ||||
-rw-r--r-- | src/server/PortImpl.cpp | 2 | ||||
-rw-r--r-- | src/server/events/SetMetadata.cpp | 13 |
3 files changed, 18 insertions, 11 deletions
diff --git a/src/server/ObjectSender.cpp b/src/server/ObjectSender.cpp index 22aff285..a166a885 100644 --- a/src/server/ObjectSender.cpp +++ b/src/server/ObjectSender.cpp @@ -134,11 +134,15 @@ ObjectSender::send_port(ClientInterface* client, const PortImpl* port, bool bund if (bundle) client->bundle_begin(); - client->put(port->path(), port->properties()); - - // Send control value - if (port->is_a(PortType::CONTROL)) - client->set_property(port->path(), port->bufs().uris().ingen_value, port->value()); + if (port->is_a(PortType::CONTROL)) { + Resource::Properties props = port->properties(); + props.erase(port->bufs().uris().ingen_value); + props.insert(make_pair(port->bufs().uris().ingen_value, + port->value())); + client->put(port->path(), props); + } else { + client->put(port->path(), port->properties()); + } if (bundle) client->bundle_end(); diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp index a448916e..6ccc4547 100644 --- a/src/server/PortImpl.cpp +++ b/src/server/PortImpl.cpp @@ -74,6 +74,8 @@ PortImpl::PortImpl(BufferFactory& bufs, if (type == PortType::EVENTS) _broadcast = true; // send activity blips + else if (type == PortType::CONTROL) + _value = Raul::Atom(0.0f); } PortImpl::~PortImpl() diff --git a/src/server/events/SetMetadata.cpp b/src/server/events/SetMetadata.cpp index 1812ad91..d9d44cc0 100644 --- a/src/server/events/SetMetadata.cpp +++ b/src/server/events/SetMetadata.cpp @@ -346,14 +346,15 @@ SetMetadata::post_process() switch (_error) { case NO_ERROR: - if (_create_event) + if (_create_event) { _create_event->post_process(); - else + } else { _request->respond_ok(); - if (_create) - _engine.broadcaster()->put(_subject, _properties, _context); - else - _engine.broadcaster()->delta(_subject, _remove, _properties); + if (_create) + _engine.broadcaster()->put(_subject, _properties, _context); + else + _engine.broadcaster()->delta(_subject, _remove, _properties); + } break; case NOT_FOUND: _request->respond_error((boost::format( |