diff options
author | David Robillard <d@drobilla.net> | 2010-02-02 01:22:20 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-02 01:22:20 +0000 |
commit | c1ac1f31457708db618143f54a3dfef7eb3361aa (patch) | |
tree | 88c91e75f4a90cf6efab9ab6f8219d53dd5b892f /src/engine | |
parent | 6e8877ee110b774caef800adbe35b21338b3372f (diff) | |
download | ingen-c1ac1f31457708db618143f54a3dfef7eb3361aa.tar.gz ingen-c1ac1f31457708db618143f54a3dfef7eb3361aa.tar.bz2 ingen-c1ac1f31457708db618143f54a3dfef7eb3361aa.zip |
Remove set_port_value from CommonInterface (replaced with set_property(path, "ingen:value", value)).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2404 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/ClientBroadcaster.hpp | 5 | ||||
-rw-r--r-- | src/engine/HTTPClientSender.cpp | 11 | ||||
-rw-r--r-- | src/engine/HTTPClientSender.hpp | 3 | ||||
-rw-r--r-- | src/engine/OSCClientSender.cpp | 17 | ||||
-rw-r--r-- | src/engine/OSCClientSender.hpp | 3 | ||||
-rw-r--r-- | src/engine/OSCEngineReceiver.cpp | 51 | ||||
-rw-r--r-- | src/engine/OSCEngineReceiver.hpp | 1 | ||||
-rw-r--r-- | src/engine/ObjectSender.cpp | 2 | ||||
-rw-r--r-- | src/engine/QueuedEngineInterface.cpp | 8 | ||||
-rw-r--r-- | src/engine/QueuedEngineInterface.hpp | 3 | ||||
-rw-r--r-- | src/engine/events/RequestMetadata.cpp | 2 | ||||
-rw-r--r-- | src/engine/events/SendPortValue.cpp | 2 | ||||
-rw-r--r-- | src/engine/events/SetPortValue.cpp | 4 |
13 files changed, 5 insertions, 107 deletions
diff --git a/src/engine/ClientBroadcaster.hpp b/src/engine/ClientBroadcaster.hpp index 096b367d..808c861a 100644 --- a/src/engine/ClientBroadcaster.hpp +++ b/src/engine/ClientBroadcaster.hpp @@ -99,11 +99,6 @@ public: BROADCAST(set_property, subject, predicate, value); } - void set_port_value(const Raul::Path& port_path, - const Raul::Atom& value) { - BROADCAST(set_port_value, port_path, value); - } - void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value) { diff --git a/src/engine/HTTPClientSender.cpp b/src/engine/HTTPClientSender.cpp index aacf9479..77f4fbad 100644 --- a/src/engine/HTTPClientSender.cpp +++ b/src/engine/HTTPClientSender.cpp @@ -115,17 +115,6 @@ HTTPClientSender::set_property(const URI& subject, const URI& key, const Atom& v void -HTTPClientSender::set_port_value(const Path& port_path, const Atom& value) -{ - Redland::Node node = AtomRDF::atom_to_node(*_engine.world()->rdf_world, value); - const string msg = string( - "@prefix ingen: <http://drobilla.net/ns/ingen#> .\n\n<").append( - port_path.str()).append("> ingen:value ").append(node.to_string()).append(" .\n"); - send_chunk(msg); -} - - -void HTTPClientSender::set_voice_value(const Path& port_path, uint32_t voice, const Atom& value) { warn << "TODO: HTTP set voice value" << endl; diff --git a/src/engine/HTTPClientSender.hpp b/src/engine/HTTPClientSender.hpp index f25e1eeb..4c975304 100644 --- a/src/engine/HTTPClientSender.hpp +++ b/src/engine/HTTPClientSender.hpp @@ -84,9 +84,6 @@ public: const Raul::URI& predicate, const Raul::Atom& value); - virtual void set_port_value(const Raul::Path& port_path, - const Raul::Atom& value); - virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); diff --git a/src/engine/OSCClientSender.cpp b/src/engine/OSCClientSender.cpp index f07668ca..6938b09a 100644 --- a/src/engine/OSCClientSender.cpp +++ b/src/engine/OSCClientSender.cpp @@ -199,23 +199,6 @@ OSCClientSender::set_property(const URI& path, const URI& key, const Atom& value /** \page client_osc_namespace * <h2>/ingen/set_port_value</h2> * \arg \b path (string) - Path of port - * \arg \b value (any) - New value of port - * - * Notification the value of a port has changed. - */ -void -OSCClientSender::set_port_value(const Path& port_path, const Atom& value) -{ - lo_message m = lo_message_new(); - lo_message_add_string(m, port_path.c_str()); - AtomLiblo::lo_message_add_atom(m, value); - send_message("/ingen/set_port_value", m); -} - - -/** \page client_osc_namespace - * <h2>/ingen/set_port_value</h2> - * \arg \b path (string) - Path of port * \arg \b voice (int) - Voice which is set to this value * \arg \b value (any) - New value of port * diff --git a/src/engine/OSCClientSender.hpp b/src/engine/OSCClientSender.hpp index 38cc3187..d7abfed0 100644 --- a/src/engine/OSCClientSender.hpp +++ b/src/engine/OSCClientSender.hpp @@ -84,9 +84,6 @@ public: const Raul::URI& predicate, const Raul::Atom& value); - virtual void set_port_value(const Raul::Path& port_path, - const Raul::Atom& value); - virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp index ee202c95..404796fd 100644 --- a/src/engine/OSCEngineReceiver.cpp +++ b/src/engine/OSCEngineReceiver.cpp @@ -100,7 +100,6 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t lo_server_add_method(_server, "/ingen/connect", "iss", connect_cb, this); lo_server_add_method(_server, "/ingen/disconnect", "iss", disconnect_cb, this); lo_server_add_method(_server, "/ingen/disconnect_all", "iss", disconnect_all_cb, this); - lo_server_add_method(_server, "/ingen/set_port_value", NULL, set_port_value_cb, this); lo_server_add_method(_server, "/ingen/note_on", "isii", note_on_cb, this); lo_server_add_method(_server, "/ingen/note_off", "isi", note_off_cb, this); lo_server_add_method(_server, "/ingen/all_notes_off", "isi", all_notes_off_cb, this); @@ -501,56 +500,6 @@ OSCEngineReceiver::_disconnect_all_cb(const char* path, const char* types, lo_ar /** \page engine_osc_namespace - * <h2>/ingen/set_port_value</h2> - * \arg \b response-id (integer) - * \arg \b port-path (string) - Name of port - * \arg \b value (float) - Value to set port to. - * - * Set the value of a port for all voices. - */ -int -OSCEngineReceiver::_set_port_value_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - if (argc < 3 || argc > 5 || strncmp(types, "is", 2)) - return 1; - - const char* port_path = &argv[1]->s; - - using Raul::Atom; - - if (!strcmp(types, "isf")) { // float, all voices - const float value = argv[2]->f; - set_port_value(port_path, Atom(value)); - } else if (!strcmp(types, "isif")) { // float, specific voice - const float value = argv[3]->f; - set_voice_value(port_path, argv[2]->i, Atom(value)); - } else if (!strcmp(types, "issb")) { // blob (event), all voices - const char* type = &argv[2]->s; - lo_blob b = argv[3]; - size_t data_size = lo_blob_datasize(b); - void* data = lo_blob_dataptr(b); - set_port_value(port_path, Atom(type, data_size, data)); - } else if (!strcmp(types, "isisb")) { // blob (event), specific voice - const char* type = &argv[3]->s; - lo_blob b = argv[4]; - size_t data_size = lo_blob_datasize(b); - void* data = lo_blob_dataptr(b); - set_voice_value(port_path, argv[2]->i, Atom(type, data_size, data)); - } else if (!strcmp(types, "issN")) { // empty event (type only), all voices - const char* type = &argv[2]->s; - set_port_value(port_path, Atom(type, 0, NULL)); - } else if (!strcmp(types, "isisN")) { // empty event (type only), specific voice - const char* type = &argv[3]->s; - set_voice_value(port_path, argv[2]->i, Atom(type, 0, NULL)); - } else { - return 1; - } - - return 0; -} - - -/** \page engine_osc_namespace * <h2>/ingen/note_on</h2> * \arg \b response-id (integer) * \arg \b node-path (string) - Patch of Node to trigger (must be a trigger or note node) diff --git a/src/engine/OSCEngineReceiver.hpp b/src/engine/OSCEngineReceiver.hpp index 6e2ce08c..c70f680f 100644 --- a/src/engine/OSCEngineReceiver.hpp +++ b/src/engine/OSCEngineReceiver.hpp @@ -96,7 +96,6 @@ private: LO_HANDLER(connect); LO_HANDLER(disconnect); LO_HANDLER(disconnect_all); - LO_HANDLER(set_port_value); LO_HANDLER(note_on); LO_HANDLER(note_off); LO_HANDLER(all_notes_off); diff --git a/src/engine/ObjectSender.cpp b/src/engine/ObjectSender.cpp index 65ad4f8b..198296ec 100644 --- a/src/engine/ObjectSender.cpp +++ b/src/engine/ObjectSender.cpp @@ -144,7 +144,7 @@ ObjectSender::send_port(ClientInterface* client, const PortImpl* port, bool bund if (port->type() == PortType::CONTROL) { //const Sample& value = PtrCast<const AudioBuffer>(port->buffer(0))->value_at(0); const Sample& value = ((const AudioBuffer*)port->buffer(0).get())->value_at(0); - client->set_port_value(port->path(), value); + client->set_property(port->path(), "ingen:value", value); } if (bundle) diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp index 575fa5d6..42978832 100644 --- a/src/engine/QueuedEngineInterface.cpp +++ b/src/engine/QueuedEngineInterface.cpp @@ -211,14 +211,6 @@ QueuedEngineInterface::disconnect_all(const Path& patch_path, void -QueuedEngineInterface::set_port_value(const Path& port_path, - const Raul::Atom& value) -{ - push_queued(new Events::SetPortValue(_engine, _responder, true, now(), port_path, value)); -} - - -void QueuedEngineInterface::set_voice_value(const Path& port_path, uint32_t voice, const Raul::Atom& value) diff --git a/src/engine/QueuedEngineInterface.hpp b/src/engine/QueuedEngineInterface.hpp index 22c92efa..c1db2ba1 100644 --- a/src/engine/QueuedEngineInterface.hpp +++ b/src/engine/QueuedEngineInterface.hpp @@ -87,9 +87,6 @@ public: const Raul::URI& predicate, const Raul::Atom& value); - virtual void set_port_value(const Raul::Path& port_path, - const Raul::Atom& value); - virtual void set_voice_value(const Raul::Path& port_path, uint32_t voice, const Raul::Atom& value); diff --git a/src/engine/events/RequestMetadata.cpp b/src/engine/events/RequestMetadata.cpp index f51651fc..c773ae3d 100644 --- a/src/engine/events/RequestMetadata.cpp +++ b/src/engine/events/RequestMetadata.cpp @@ -113,7 +113,7 @@ RequestMetadata::post_process() if (_special_type == PORT_VALUE) { if (_resource) { _responder->respond_ok(); - _responder->client()->set_port_value(_uri.str(), _value); + _responder->client()->set_property(_uri.str(), "ingen:value", _value); } else { const string msg = "Get value for non-port " + _uri.str(); _responder->respond_error(msg); diff --git a/src/engine/events/SendPortValue.cpp b/src/engine/events/SendPortValue.cpp index 1052033b..52592d81 100644 --- a/src/engine/events/SendPortValue.cpp +++ b/src/engine/events/SendPortValue.cpp @@ -31,7 +31,7 @@ void SendPortValue::post_process() { if (_omni) { - _engine.broadcaster()->set_port_value(_port->path(), _value); + _engine.broadcaster()->set_property(_port->path(), "ingen:value", _value); } else { _engine.broadcaster()->set_voice_value(_port->path(), _voice_num, _value); } diff --git a/src/engine/events/SetPortValue.cpp b/src/engine/events/SetPortValue.cpp index 6c87ef94..f1abc720 100644 --- a/src/engine/events/SetPortValue.cpp +++ b/src/engine/events/SetPortValue.cpp @@ -231,7 +231,7 @@ SetPortValue::post_process() assert(_port != NULL); _responder->respond_ok(); if (_omni) - _engine.broadcaster()->set_port_value(_port_path, _value); + _engine.broadcaster()->set_property(_port_path, "ingen:value", _value); else _engine.broadcaster()->set_voice_value(_port_path, _voice_num, _value); break; @@ -246,7 +246,7 @@ SetPortValue::post_process() break; case PORT_NOT_FOUND: msg = "Unable to find port "; - msg.append(_port_path.str()).append(" for set_port_value"); + msg.append(_port_path.str()).append(" to set value"); _responder->respond_error(msg); break; case NO_SPACE: |