diff options
author | David Robillard <d@drobilla.net> | 2012-05-10 02:14:55 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-05-10 02:14:55 +0000 |
commit | 281bbcc6a7208c28283bc9bdd521c5d6cc48a60f (patch) | |
tree | 6cfc2bf6c3c0d92b3cb5a79a4d019d5952d41989 /src/shared | |
parent | cd2ac251d7e076e3bf25f2640d1684447efa83d3 (diff) | |
download | ingen-281bbcc6a7208c28283bc9bdd521c5d6cc48a60f.tar.gz ingen-281bbcc6a7208c28283bc9bdd521c5d6cc48a60f.tar.bz2 ingen-281bbcc6a7208c28283bc9bdd521c5d6cc48a60f.zip |
Bidirectional socket communication (GUI once again works remotely).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4335 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/AtomReader.cpp | 16 | ||||
-rw-r--r-- | src/shared/AtomWriter.cpp | 2 | ||||
-rw-r--r-- | src/shared/Configuration.cpp | 2 | ||||
-rw-r--r-- | src/shared/World.cpp | 4 |
4 files changed, 21 insertions, 3 deletions
diff --git a/src/shared/AtomReader.cpp b/src/shared/AtomReader.cpp index 7cafd919..45b60c35 100644 --- a/src/shared/AtomReader.cpp +++ b/src/shared/AtomReader.cpp @@ -188,6 +188,22 @@ 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_Response) { + const LV2_Atom* request = NULL; + const LV2_Atom* body = NULL; + lv2_atom_object_get(obj, + (LV2_URID)_uris.patch_request, &request, + (LV2_URID)_uris.patch_body, &body, + 0); + if (!request || request->type != _uris.atom_Int) { + Raul::warn << "Response message has no request" << std::endl; + return; + } else if (!body || body->type != _uris.atom_Int) { + Raul::warn << "Response message body is not integer" << std::endl; + return; + } + _iface.response(((LV2_Atom_Int*)request)->body, + (Ingen::Status)((LV2_Atom_Int*)body)->body); } 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 c9af3002..8d88ef11 100644 --- a/src/shared/AtomWriter.cpp +++ b/src/shared/AtomWriter.cpp @@ -264,6 +264,8 @@ 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); + lv2_atom_forge_property_head(&_forge, _uris.patch_body, 0); + lv2_atom_forge_int(&_forge, status); lv2_atom_forge_pop(&_forge, &msg); finish_msg(); } diff --git a/src/shared/Configuration.cpp b/src/shared/Configuration.cpp index f1eda529..aecf0e5b 100644 --- a/src/shared/Configuration.cpp +++ b/src/shared/Configuration.cpp @@ -37,7 +37,7 @@ Configuration::Configuration() " ingen -egl patch.ingen # Run an engine and a GUI and load a patch bundle") { add("client-port", 'C', "Client port", INT, Value()); - add("connect", 'c', "Connect to engine URI", STRING, Value("osc.udp://localhost:16180")); + add("connect", 'c', "Connect to engine URI", STRING, Value("unix:///tmp/ingen.sock")); add("engine", 'e', "Run (JACK) engine", BOOL, Value(false)); add("engine-port", 'E', "Engine listen port", INT, Value(16180)); add("socket", 'S', "Engine socket path", STRING, Value("/tmp/ingen.sock")); diff --git a/src/shared/World.cpp b/src/shared/World.cpp index b99dfd1a..d2d5f74c 100644 --- a/src/shared/World.cpp +++ b/src/shared/World.cpp @@ -273,7 +273,7 @@ World::unload_modules() */ SharedPtr<Interface> World::interface(const std::string& engine_url, - SharedPtr<Interface> respond_to) + SharedPtr<Interface> respondee) { const string scheme = engine_url.substr(0, engine_url.find(":")); const Pimpl::InterfaceFactories::const_iterator i = _impl->interface_factories.find(scheme); @@ -282,7 +282,7 @@ World::interface(const std::string& engine_url, return SharedPtr<Interface>(); } - return i->second(this, engine_url, respond_to); + return i->second(this, engine_url, respondee); } /** Run a script of type @a mime_type at filename @a filename */ |