summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/Engine.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-09 14:24:56 +0000
committerDavid Robillard <d@drobilla.net>2006-09-09 14:24:56 +0000
commitfca95e5d454d37bd74b98f5bce35cfcbaee86c3f (patch)
tree97fcf6e8afaf4356d46a24236e9aa2451ab55698 /src/libs/engine/Engine.cpp
parentb853b3dde1f7028dd275f78433a6ad9b5b9f61c7 (diff)
downloadingen-fca95e5d454d37bd74b98f5bce35cfcbaee86c3f.tar.gz
ingen-fca95e5d454d37bd74b98f5bce35cfcbaee86c3f.tar.bz2
ingen-fca95e5d454d37bd74b98f5bce35cfcbaee86c3f.zip
Drove 'er home! Working monolothic Ingenuity (ie. in-process engine).
Countless bugfixes. git-svn-id: http://svn.drobilla.net/lad/ingen@123 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/Engine.cpp')
-rw-r--r--src/libs/engine/Engine.cpp31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/libs/engine/Engine.cpp b/src/libs/engine/Engine.cpp
index ebe8e4f7..94f964dc 100644
--- a/src/libs/engine/Engine.cpp
+++ b/src/libs/engine/Engine.cpp
@@ -60,7 +60,7 @@ Engine::Engine(AudioDriver* audio_driver)
#endif
m_maid(new Maid(maid_queue_size)),
m_post_processor(new PostProcessor(*m_maid, post_processor_queue_size)),
- m_client_broadcaster(new ClientBroadcaster()),
+ m_broadcaster(new ClientBroadcaster()),
m_object_store(new ObjectStore()),
m_node_factory(new NodeFactory()),
#ifdef HAVE_LASH
@@ -85,7 +85,7 @@ Engine::~Engine()
}
delete m_object_store;
- delete m_client_broadcaster;
+ delete m_broadcaster;
delete m_node_factory;
delete m_midi_driver;
delete m_audio_driver;
@@ -114,13 +114,7 @@ Engine::main()
// Loop until quit flag is set (by OSCReceiver)
while ( ! m_quit_flag) {
nanosleep(&main_rate, NULL);
-#ifdef HAVE_LASH
- // Process any pending LASH events
- if (lash_driver->enabled())
- lash_driver->process_events();
-#endif
- // Run the maid (garbage collector)
- m_maid->cleanup();
+ main_iteration();
}
cout << "[Main] Done main loop." << endl;
@@ -134,6 +128,25 @@ Engine::main()
}
+/** Run one iteration of the main loop.
+ *
+ * NOT realtime safe (this is where deletion actually occurs)
+ */
+bool
+Engine::main_iteration()
+{
+#ifdef HAVE_LASH
+ // Process any pending LASH events
+ if (lash_driver->enabled())
+ lash_driver->process_events();
+#endif
+ // Run the maid (garbage collector)
+ m_maid->cleanup();
+
+ return !m_quit_flag;
+}
+
+
void
Engine::activate()
{