summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/OSCEngineReceiver.cpp30
-rw-r--r--src/engine/OSCEngineReceiver.hpp2
-rw-r--r--src/engine/QueuedEngineInterface.cpp35
-rw-r--r--src/engine/QueuedEngineInterface.hpp2
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