diff options
author | David Robillard <d@drobilla.net> | 2011-04-19 21:07:07 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-19 21:07:07 +0000 |
commit | 08759b27bc19de59bfd17fc929ee7e0021181ffb (patch) | |
tree | 111d19160758efc7ae3e120ec4212fed2aa79558 /src/engine | |
parent | c9683eb916ff52ab6907773360c655d776b24f23 (diff) | |
download | ingen-08759b27bc19de59bfd17fc929ee7e0021181ffb.tar.gz ingen-08759b27bc19de59bfd17fc929ee7e0021181ffb.tar.bz2 ingen-08759b27bc19de59bfd17fc929ee7e0021181ffb.zip |
Remove EngineInterface::activate() and EngineInterface::deactivate().
Use set_property("ingen:driver", "ingen:enabled", true | false) instead.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3171 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/OSCEngineReceiver.cpp | 30 | ||||
-rw-r--r-- | src/engine/OSCEngineReceiver.hpp | 2 | ||||
-rw-r--r-- | src/engine/QueuedEngineInterface.cpp | 35 | ||||
-rw-r--r-- | src/engine/QueuedEngineInterface.hpp | 2 |
4 files changed, 17 insertions, 52 deletions
diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp index 59aac9e4..1b8d1179 100644 --- a/src/engine/OSCEngineReceiver.cpp +++ b/src/engine/OSCEngineReceiver.cpp @@ -97,8 +97,6 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t lo_server_add_method(_server, "/quit", "i", quit_cb, this); lo_server_add_method(_server, "/register_client", "i", register_client_cb, this); lo_server_add_method(_server, "/unregister_client", "i", unregister_client_cb, this); - lo_server_add_method(_server, "/activate", "i", engine_activate_cb, this); - lo_server_add_method(_server, "/deactivate", "i", engine_deactivate_cb, this); lo_server_add_method(_server, "/put", NULL, put_cb, this); lo_server_add_method(_server, "/move", "iss", move_cb, this); lo_server_add_method(_server, "/delete", "is", del_cb, this); @@ -328,34 +326,6 @@ OSCEngineReceiver::_unregister_client_cb(const char* path, const char* types, lo } /** \page engine_osc_namespace - * <h2>/activate</h2> - * \arg \b response-id (integer) - * - * Activate the engine (event processing and all drivers, e.g. audio and MIDI). - * Note that you <b>must</b> send this message first if you want the engine to do - * anything at all - <em>including respond to your messages!</em> - */ -int -OSCEngineReceiver::_engine_activate_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - QueuedEngineInterface::activate(); - return 0; -} - -/** \page engine_osc_namespace - * <h2>/deactivate</h2> - * \arg \b response-id (integer) - * - * Deactivate the engine. - */ -int -OSCEngineReceiver::_engine_deactivate_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - QueuedEngineInterface::deactivate(); - return 0; -} - -/** \page engine_osc_namespace * <h2>/get</h2> * \arg \b response-id (integer) * \arg \b uri (string) - URI of object (patch, port, node, plugin) to send diff --git a/src/engine/OSCEngineReceiver.hpp b/src/engine/OSCEngineReceiver.hpp index e32cd4ae..4293f890 100644 --- a/src/engine/OSCEngineReceiver.hpp +++ b/src/engine/OSCEngineReceiver.hpp @@ -94,8 +94,6 @@ private: LO_HANDLER(ping_slow); LO_HANDLER(register_client); LO_HANDLER(unregister_client); - LO_HANDLER(engine_activate); - LO_HANDLER(engine_deactivate); LO_HANDLER(get); LO_HANDLER(put); LO_HANDLER(move); diff --git a/src/engine/QueuedEngineInterface.cpp b/src/engine/QueuedEngineInterface.cpp index 8e9363ec..1fc68799 100644 --- a/src/engine/QueuedEngineInterface.cpp +++ b/src/engine/QueuedEngineInterface.cpp @@ -100,19 +100,6 @@ QueuedEngineInterface::unregister_client(const URI& uri) // Engine commands void -QueuedEngineInterface::activate() -{ - _engine.activate(); - push_queued(new Events::Ping(_engine, _request, now())); -} - -void -QueuedEngineInterface::deactivate() -{ - push_queued(new Events::Deactivate(_engine, _request, now())); -} - -void QueuedEngineInterface::quit() { _request->respond_ok(); @@ -191,11 +178,23 @@ QueuedEngineInterface::set_property(const URI& uri, const URI& predicate, const Atom& value) { - Resource::Properties remove; - remove.insert(make_pair(predicate, _engine.world()->uris()->wildcard)); - Resource::Properties add; - add.insert(make_pair(predicate, value)); - push_queued(new Events::SetMetadata(_engine, _request, now(), false, Resource::DEFAULT, uri, add, remove)); + if (uri == "ingen:engine" && predicate == "ingen:enabled" + && value.type() == Atom::BOOL) { + if (value.get_bool()) { + _engine.activate(); + push_queued(new Events::Ping(_engine, _request, now())); + } else { + push_queued(new Events::Deactivate(_engine, _request, now())); + } + } else { + Resource::Properties remove; + remove.insert(make_pair(predicate, _engine.world()->uris()->wildcard)); + Resource::Properties add; + add.insert(make_pair(predicate, value)); + push_queued(new Events::SetMetadata( + _engine, _request, now(), false, Resource::DEFAULT, + uri, add, remove)); + } } // Requests // diff --git a/src/engine/QueuedEngineInterface.hpp b/src/engine/QueuedEngineInterface.hpp index a2c13040..dede135e 100644 --- a/src/engine/QueuedEngineInterface.hpp +++ b/src/engine/QueuedEngineInterface.hpp @@ -60,8 +60,6 @@ public: virtual void unregister_client(const Raul::URI& uri); // Engine commands - virtual void activate(); - virtual void deactivate(); virtual void quit(); // Bundles |