summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/ingen/EngineInterface.hpp2
-rw-r--r--src/client/HTTPEngineSender.cpp10
-rw-r--r--src/client/HTTPEngineSender.hpp2
-rw-r--r--src/client/OSCEngineSender.cpp12
-rw-r--r--src/client/OSCEngineSender.hpp2
-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
-rw-r--r--src/gui/ConnectWindow.cpp8
-rw-r--r--src/ingen/main.cpp2
11 files changed, 23 insertions, 84 deletions
diff --git a/include/ingen/EngineInterface.hpp b/include/ingen/EngineInterface.hpp
index 5cb05286..6d89797c 100644
--- a/include/ingen/EngineInterface.hpp
+++ b/include/ingen/EngineInterface.hpp
@@ -47,8 +47,6 @@ public:
virtual void unregister_client(const Raul::URI& uri) = 0;
// Engine commands
- virtual void activate() = 0;
- virtual void deactivate() = 0;
virtual void quit() = 0;
// Object commands
diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp
index 31e1238c..e188b010 100644
--- a/src/client/HTTPEngineSender.cpp
+++ b/src/client/HTTPEngineSender.cpp
@@ -81,16 +81,6 @@ HTTPEngineSender::unregister_client(const URI& uri)
// Engine commands
void
-HTTPEngineSender::activate()
-{
-}
-
-void
-HTTPEngineSender::deactivate()
-{
-}
-
-void
HTTPEngineSender::quit()
{
}
diff --git a/src/client/HTTPEngineSender.hpp b/src/client/HTTPEngineSender.hpp
index 3a0b1a40..549ad07a 100644
--- a/src/client/HTTPEngineSender.hpp
+++ b/src/client/HTTPEngineSender.hpp
@@ -73,8 +73,6 @@ public:
void unregister_client(const Raul::URI& uri);
// Engine commands
- void activate();
- void deactivate();
void quit();
// Object commands
diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp
index f78583f9..3c9b60b4 100644
--- a/src/client/OSCEngineSender.cpp
+++ b/src/client/OSCEngineSender.cpp
@@ -101,18 +101,6 @@ OSCEngineSender::unregister_client(const URI& uri)
// Engine commands
void
-OSCEngineSender::activate()
-{
- send("/activate", "i", next_id(), LO_ARGS_END);
-}
-
-void
-OSCEngineSender::deactivate()
-{
- send("/deactivate", "i", next_id(), LO_ARGS_END);
-}
-
-void
OSCEngineSender::quit()
{
send("/quit", "i", next_id(), LO_ARGS_END);
diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp
index 30e82c5f..75cf3db1 100644
--- a/src/client/OSCEngineSender.hpp
+++ b/src/client/OSCEngineSender.hpp
@@ -74,8 +74,6 @@ public:
void unregister_client(const Raul::URI& uri);
// Engine commands
- void activate();
- void deactivate();
void quit();
// Object commands
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
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index e5ade51c..f93ebf4c 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -288,13 +288,17 @@ ConnectWindow::disconnect()
void
ConnectWindow::activate()
{
- App::instance().engine()->activate();
+ App::instance().engine()->set_property("ingen:driver",
+ "ingen:enabled",
+ true);
}
void
ConnectWindow::deactivate()
{
- App::instance().engine()->deactivate();
+ App::instance().engine()->set_property("ingen:driver",
+ "ingen:enabled",
+ false);
}
void
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp
index 0767e328..4691c302 100644
--- a/src/ingen/main.cpp
+++ b/src/ingen/main.cpp
@@ -225,8 +225,6 @@ main(int argc, char** argv)
nanosleep(&main_rate, NULL);
}
info << "Finished main loop" << endl;
-
- world->local_engine()->deactivate();
}
// Shut down