summaryrefslogtreecommitdiffstats
path: root/src/libs/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine')
-rw-r--r--src/libs/engine/Engine.cpp27
-rw-r--r--src/libs/engine/NodeFactory.cpp6
-rw-r--r--src/libs/engine/PostProcessor.cpp4
-rw-r--r--src/libs/engine/QueuedEngineInterface.cpp1
-rw-r--r--src/libs/engine/util.hpp2
5 files changed, 19 insertions, 21 deletions
diff --git a/src/libs/engine/Engine.cpp b/src/libs/engine/Engine.cpp
index 44cac86c..004de200 100644
--- a/src/libs/engine/Engine.cpp
+++ b/src/libs/engine/Engine.cpp
@@ -120,10 +120,7 @@ Engine::main()
}
cout << "[Main] Done main loop." << endl;
- _event_source->deactivate();
-
- if (_activated)
- deactivate();
+ deactivate();
return 0;
}
@@ -152,23 +149,21 @@ Engine::main_iteration()
void
Engine::start_jack_driver()
{
- if (_audio_driver)
- cerr << "[Engine] Warning: replaced audio driver" << endl;
-
- _audio_driver = SharedPtr<AudioDriver>(new JackAudioDriver(*this));
+ if ( ! _audio_driver)
+ _audio_driver = SharedPtr<AudioDriver>(new JackAudioDriver(*this));
+ else
+ cerr << "[Engine::start_jack_driver] Audio driver already running" << endl;
}
void
Engine::start_osc_driver(int port)
{
- if (_event_source)
- cerr << "[Engine] Warning: replaced event source (engine interface)" << endl;
-
- _event_source = SharedPtr<EventSource>(new OSCEngineReceiver(
- *this, pre_processor_queue_size, port));
-
- //_osc_driver = _event_source;
+ if ( ! _event_source)
+ _event_source = SharedPtr<EventSource>(new OSCEngineReceiver(
+ *this, pre_processor_queue_size, port));
+ else
+ cerr << "[Engine::start_osc_driver] Event source already running" << endl;
}
@@ -247,6 +242,8 @@ Engine::deactivate()
{
if (!_activated)
return;
+
+ _event_source->deactivate();
/*for (Tree<GraphObject*>::iterator i = _object_store->objects().begin();
i != _object_store->objects().end(); ++i)
diff --git a/src/libs/engine/NodeFactory.cpp b/src/libs/engine/NodeFactory.cpp
index b2714e23..c2b9536a 100644
--- a/src/libs/engine/NodeFactory.cpp
+++ b/src/libs/engine/NodeFactory.cpp
@@ -336,7 +336,11 @@ NodeFactory::load_lv2_plugin(const string& plug_uri,
if (plugin) {
n = new LV2Node(plugin, node_name, polyphonic, parent, srate, buffer_size);
- bool success = ((LV2Node*)n)->instantiate();
+
+ Glib::Mutex::Lock lock(_world->rdf_world->mutex());
+
+ const bool success = ((LV2Node*)n)->instantiate();
+
if (!success) {
delete n;
n = NULL;
diff --git a/src/libs/engine/PostProcessor.cpp b/src/libs/engine/PostProcessor.cpp
index 96aee3b1..a50ca275 100644
--- a/src/libs/engine/PostProcessor.cpp
+++ b/src/libs/engine/PostProcessor.cpp
@@ -53,12 +53,10 @@ PostProcessor::process()
while (_engine.audio_driver()->context().event_sink().read(
_event_buffer_size, _event_buffer)) {
if (((Event*)_event_buffer)->time() > end_time)
- break;
+ break; // FIXME: loses event?
((Event*)_event_buffer)->post_process();
}
-
-
/* Process normal events */
while ( ! _events.empty()) {
Event* const ev = _events.front();
diff --git a/src/libs/engine/QueuedEngineInterface.cpp b/src/libs/engine/QueuedEngineInterface.cpp
index 053c0ff8..a2603665 100644
--- a/src/libs/engine/QueuedEngineInterface.cpp
+++ b/src/libs/engine/QueuedEngineInterface.cpp
@@ -38,6 +38,7 @@ QueuedEngineInterface::now() const
{
// Exactly one cycle latency (some could run ASAP if we get lucky, but not always, and a slight
// constant latency is far better than jittery lower (average) latency
+ assert(_engine.audio_driver());
return _engine.audio_driver()->frame_time() + _engine.audio_driver()->buffer_size();
}
diff --git a/src/libs/engine/util.hpp b/src/libs/engine/util.hpp
index ce943673..4d03d94e 100644
--- a/src/libs/engine/util.hpp
+++ b/src/libs/engine/util.hpp
@@ -65,8 +65,6 @@ set_denormal_flags()
exit(EXIT_FAILURE);
}
#endif
- // Set 387 control register via standard C99 interface
- fesetround(FE_TOWARDZERO);
}
} // namespace Ingen