diff options
author | David Robillard <d@drobilla.net> | 2011-04-16 00:24:10 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-16 00:24:10 +0000 |
commit | 2b04af0ab5d18d3116290fab7febac86f41068c9 (patch) | |
tree | d39059c5e1b466df5c1a77f3cf8ef809051497c4 /src/engine/Engine.cpp | |
parent | e4faf89e42e68b9eb13a23b0bdef7c00169c3831 (diff) | |
download | ingen-2b04af0ab5d18d3116290fab7febac86f41068c9.tar.gz ingen-2b04af0ab5d18d3116290fab7febac86f41068c9.tar.bz2 ingen-2b04af0ab5d18d3116290fab7febac86f41068c9.zip |
Simpler and documented Engine main loop interface.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3150 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/Engine.cpp')
-rw-r--r-- | src/engine/Engine.cpp | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index 6a3d25a6..b57fa542 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -65,7 +65,6 @@ Engine::Engine(Ingen::Shared::World* a_world) , _node_factory(new NodeFactory(a_world)) , _message_context(new MessageContext(*this)) , _buffer_factory(new BufferFactory(*this, a_world->uris())) - //, _buffer_factory(NULL) , _control_bindings(new ControlBindings(*this)) , _quit_flag(false) , _activated(false) @@ -105,46 +104,22 @@ Engine::engine_store() const } -int -Engine::main() +void +Engine::quit() { - Raul::Thread::get().set_context(THREAD_POST_PROCESS); - - // Loop until quit flag is set - while (!_quit_flag) { - nanosleep(&main_rate, NULL); - main_iteration(); - } - info << "Finished main loop" << endl; - - deactivate(); - - return 0; + _quit_flag = true; } - -/** Run one iteration of the main loop. - * - * NOT realtime safe (this is where deletion actually occurs) - */ bool Engine::main_iteration() { _post_processor->process(); _maid->cleanup(); - return !_quit_flag; } void -Engine::quit() -{ - _quit_flag = true; -} - - -void Engine::add_event_source(SharedPtr<EventSource> source) { _event_sources.insert(source); |