diff options
author | David Robillard <d@drobilla.net> | 2008-11-16 16:50:59 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-16 16:50:59 +0000 |
commit | 422694ebc886882fc8c2f0555a725d052dfc935c (patch) | |
tree | 39474e6c6dea95328eeed3963d5dcf0f958397d1 /src/client | |
parent | f1b0b3495340399bebb93b20ed9a264a3db4e5da (diff) | |
download | ingen-422694ebc886882fc8c2f0555a725d052dfc935c.tar.gz ingen-422694ebc886882fc8c2f0555a725d052dfc935c.tar.bz2 ingen-422694ebc886882fc8c2f0555a725d052dfc935c.zip |
More HTTP.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1726 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ClientStore.cpp | 11 | ||||
-rw-r--r-- | src/client/ClientStore.hpp | 2 | ||||
-rw-r--r-- | src/client/HTTPEngineSender.cpp | 7 | ||||
-rw-r--r-- | src/client/HTTPEngineSender.hpp | 4 | ||||
-rw-r--r-- | src/client/OSCEngineSender.cpp | 10 | ||||
-rw-r--r-- | src/client/OSCEngineSender.hpp | 2 | ||||
-rw-r--r-- | src/client/SigClientInterface.hpp | 6 | ||||
-rw-r--r-- | src/client/ThreadedSigClientInterface.cpp | 10 | ||||
-rw-r--r-- | src/client/ThreadedSigClientInterface.hpp | 2 |
9 files changed, 34 insertions, 20 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 4c4e452c..cf1109cf 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -44,6 +44,7 @@ ClientStore::ClientStore(SharedPtr<EngineInterface> engine, SharedPtr<SigClientI emitter->signal_object_destroyed.connect(sigc::mem_fun(this, &ClientStore::destroy)); emitter->signal_object_renamed.connect(sigc::mem_fun(this, &ClientStore::rename)); + emitter->signal_new_object.connect(sigc::mem_fun(this, &ClientStore::new_object)); emitter->signal_new_plugin.connect(sigc::mem_fun(this, &ClientStore::new_plugin)); emitter->signal_new_patch.connect(sigc::mem_fun(this, &ClientStore::new_patch)); emitter->signal_new_node.connect(sigc::mem_fun(this, &ClientStore::new_node)); @@ -428,7 +429,7 @@ ClientStore::new_plugin(const string& uri, const string& type_uri, const string& } -void +bool ClientStore::new_object(const Shared::GraphObject* object) { using namespace Shared; @@ -436,20 +437,22 @@ ClientStore::new_object(const Shared::GraphObject* object) const Patch* patch = dynamic_cast<const Patch*>(object); if (patch) { new_patch(patch->path(), patch->internal_polyphony()); - return; + return true; } const Node* node = dynamic_cast<const Node*>(object); if (node) { new_node(node->path(), node->plugin()->uri()); - return; + return true; } const Port* port = dynamic_cast<const Port*>(object); if (port) { new_port(port->path(), port->type().uri(), port->index(), !port->is_input()); - return; + return true; } + + return false; } diff --git a/src/client/ClientStore.hpp b/src/client/ClientStore.hpp index 2387f519..1d5c4589 100644 --- a/src/client/ClientStore.hpp +++ b/src/client/ClientStore.hpp @@ -70,7 +70,7 @@ public: // CommonInterface void new_plugin(const string& uri, const string& type_uri, const string& symbol, const string& name); - void new_object(const Shared::GraphObject* object); + bool new_object(const Shared::GraphObject* object); void new_patch(const string& path, uint32_t poly); void new_node(const string& path, const string& plugin_uri); void new_port(const string& path, const string& type, uint32_t index, bool is_output); diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp index 7a6366e0..4dbcb4b2 100644 --- a/src/client/HTTPEngineSender.cpp +++ b/src/client/HTTPEngineSender.cpp @@ -113,6 +113,13 @@ HTTPEngineSender::new_port(const string& path, uint32_t index, bool is_output) { + const string uri = _engine_url + "/patch" + path; + cout << "HTTP " << uri << " NEW PORT: " << path << endl; + SoupMessage* msg = soup_message_new("PUT", uri.c_str()); + string str = string("NEW PORT").append(path).append(type); + soup_message_set_request(msg, "application/x-turtle", + SOUP_MEMORY_COPY, str.c_str(), str.length()); + soup_session_send_message(_session, msg); } diff --git a/src/client/HTTPEngineSender.hpp b/src/client/HTTPEngineSender.hpp index 67cf9152..89a20273 100644 --- a/src/client/HTTPEngineSender.hpp +++ b/src/client/HTTPEngineSender.hpp @@ -61,8 +61,8 @@ public: void bundle_begin() { transfer_begin(); } void bundle_end() { transfer_end(); } - void transfer_begin(); - void transfer_end(); + void transfer_begin() {} + void transfer_end() {} // Client registration void register_client(ClientInterface* client); diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp index 7392f9d2..592702a3 100644 --- a/src/client/OSCEngineSender.cpp +++ b/src/client/OSCEngineSender.cpp @@ -131,7 +131,7 @@ OSCEngineSender::quit() // Object commands -void +bool OSCEngineSender::new_object(const Shared::GraphObject* object) { using namespace Shared; @@ -139,20 +139,22 @@ OSCEngineSender::new_object(const Shared::GraphObject* object) const Patch* patch = dynamic_cast<const Patch*>(object); if (patch) { new_patch(patch->path(), patch->internal_polyphony()); - return; + return true; } const Node* node = dynamic_cast<const Node*>(object); if (node) { new_node(node->path(), node->plugin()->uri()); - return; + return true; } const Port* port = dynamic_cast<const Port*>(object); if (port) { new_port(port->path(), port->type().uri(), port->index(), !port->is_input()); - return; + return true; } + + return false; } diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp index ba851d68..22de8e70 100644 --- a/src/client/OSCEngineSender.hpp +++ b/src/client/OSCEngineSender.hpp @@ -80,7 +80,7 @@ public: // Object commands - void new_object(const Shared::GraphObject* object); + bool new_object(const Shared::GraphObject* object); void new_patch(const string& path, uint32_t poly); diff --git a/src/client/SigClientInterface.hpp b/src/client/SigClientInterface.hpp index 046dbcbb..05f027a4 100644 --- a/src/client/SigClientInterface.hpp +++ b/src/client/SigClientInterface.hpp @@ -47,7 +47,7 @@ public: std::string uri() const { return "(internal)"; } // Signal parameters match up directly with ClientInterface calls - sigc::signal<void, const Shared::GraphObject*> signal_new_object; + sigc::signal<bool, const Shared::GraphObject*> signal_new_object; sigc::signal<void, int32_t> signal_response_ok; sigc::signal<void, int32_t, string> signal_response_error; @@ -104,8 +104,8 @@ protected: void new_plugin(const string& uri, const string& type_uri, const string& symbol, const string& name) { if (_enabled) signal_new_plugin.emit(uri, type_uri, symbol, name); } - void new_object(const Shared::GraphObject* object) - { if (_enabled) signal_new_object.emit(object); } + bool new_object(const Shared::GraphObject* object) + { if (_enabled) signal_new_object.emit(object); return false; } void new_patch(const string& path, uint32_t poly) { if (_enabled) signal_new_patch.emit(path, poly); } diff --git a/src/client/ThreadedSigClientInterface.cpp b/src/client/ThreadedSigClientInterface.cpp index b430a0a0..bc7707f3 100644 --- a/src/client/ThreadedSigClientInterface.cpp +++ b/src/client/ThreadedSigClientInterface.cpp @@ -77,27 +77,29 @@ ThreadedSigClientInterface::emit_signals() } -void +bool ThreadedSigClientInterface::new_object(const Shared::GraphObject* object) { using namespace Shared; const Patch* patch = dynamic_cast<const Patch*>(object); if (patch) { new_patch(patch->path(), patch->internal_polyphony()); - return; + return true; } const Node* node = dynamic_cast<const Node*>(object); if (node) { new_node(node->path(), node->plugin()->uri()); - return; + return true; } const Port* port = dynamic_cast<const Port*>(object); if (port) { new_port(port->path(), port->type().uri(), port->index(), !port->is_input()); - return; + return true; } + + return false; } diff --git a/src/client/ThreadedSigClientInterface.hpp b/src/client/ThreadedSigClientInterface.hpp index 984f9cad..dc3e342e 100644 --- a/src/client/ThreadedSigClientInterface.hpp +++ b/src/client/ThreadedSigClientInterface.hpp @@ -97,7 +97,7 @@ public: void new_plugin(const string& uri, const string& type_uri, const string& symbol, const string& name) { push_sig(sigc::bind(new_plugin_slot, uri, type_uri, symbol, name)); } - void new_object(const Shared::GraphObject* object); + bool new_object(const Shared::GraphObject* object); void new_patch(const string& path, uint32_t poly) { push_sig(sigc::bind(new_patch_slot, path, poly)); } |