From e9d9569271ee962c09ab66c6babed1ca5655a6c6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 12 Mar 2012 02:28:21 +0000 Subject: Unify event response mechanism and make it more appropriate for wire transmission. The downside being more cryptic error messages until the client side error reporting stuff gets more fancy, but the important part is that belongs client side. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4053 a436a847-0d15-0410-975c-d299462d15a1 --- include/ingen/client/SigClientInterface.hpp | 10 +++------- include/ingen/client/ThreadedSigClientInterface.hpp | 13 ++++--------- 2 files changed, 7 insertions(+), 16 deletions(-) (limited to 'include/ingen/client') diff --git a/include/ingen/client/SigClientInterface.hpp b/include/ingen/client/SigClientInterface.hpp index ae42b169..559d1b15 100644 --- a/include/ingen/client/SigClientInterface.hpp +++ b/include/ingen/client/SigClientInterface.hpp @@ -44,8 +44,7 @@ public: Raul::URI uri() const { return "http://drobilla.net/ns/ingen#internal"; } - INGEN_SIGNAL(response_ok, void, int32_t) - INGEN_SIGNAL(response_error, void, int32_t, std::string) + INGEN_SIGNAL(response, void, int32_t, Status) INGEN_SIGNAL(bundle_begin, void) INGEN_SIGNAL(bundle_end, void) INGEN_SIGNAL(error, void, std::string) @@ -78,11 +77,8 @@ protected: void bundle_end() { EMIT(bundle_end); } - void response_ok(int32_t id) - { EMIT(response_ok, id); } - - void response_error(int32_t id, const std::string& msg) - { EMIT(response_error, id, msg); } + void response(int32_t id, Status status) + { EMIT(response, id, status); } void error(const std::string& msg) { EMIT(error, msg); } diff --git a/include/ingen/client/ThreadedSigClientInterface.hpp b/include/ingen/client/ThreadedSigClientInterface.hpp index 3de2eaea..6ded560e 100644 --- a/include/ingen/client/ThreadedSigClientInterface.hpp +++ b/include/ingen/client/ThreadedSigClientInterface.hpp @@ -53,8 +53,7 @@ class ThreadedSigClientInterface : public SigClientInterface public: ThreadedSigClientInterface(uint32_t queue_size) : _sigs(queue_size) - , response_ok_slot(_signal_response_ok.make_slot()) - , response_error_slot(_signal_response_error.make_slot()) + , response_slot(_signal_response.make_slot()) , error_slot(_signal_error.make_slot()) , new_port_slot(_signal_new_port.make_slot()) , put_slot(_signal_put.make_slot()) @@ -77,11 +76,8 @@ public: void bundle_end() { push_sig(bundle_end_slot); } - void response_ok(int32_t id) - { push_sig(sigc::bind(response_ok_slot, id)); } - - void response_error(int32_t id, const std::string& msg) - { push_sig(sigc::bind(response_error_slot, id, msg)); } + void response(int32_t id, Status status) + { push_sig(sigc::bind(response_slot, id, status)); } void error(const std::string& msg) { push_sig(sigc::bind(error_slot, msg)); } @@ -130,8 +126,7 @@ private: sigc::slot bundle_begin_slot; sigc::slot bundle_end_slot; - sigc::slot response_ok_slot; - sigc::slot response_error_slot; + sigc::slot response_slot; sigc::slot error_slot; sigc::slot new_plugin_slot; sigc::slot new_port_slot; -- cgit v1.2.1