summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-04-16 21:50:14 +0000
committerDavid Robillard <d@drobilla.net>2011-04-16 21:50:14 +0000
commitda618852b67d64f5fed686234f5a626c33812c87 (patch)
tree2226d335f85478689a9c0f83f1f58bd9e29d635e /src/engine
parente867b85118f275a263ef1a3162567d90be62d0ac (diff)
downloadingen-da618852b67d64f5fed686234f5a626c33812c87.tar.gz
ingen-da618852b67d64f5fed686234f5a626c33812c87.tar.bz2
ingen-da618852b67d64f5fed686234f5a626c33812c87.zip
Add EngineBase, a pure virtual public interface for the engine.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3155 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/Engine.hpp5
-rw-r--r--src/engine/LV2RequestRunFeature.hpp5
-rw-r--r--src/engine/ingen_jack.cpp5
-rw-r--r--src/engine/ingen_lv2.cpp18
-rw-r--r--src/engine/ingen_osc.cpp5
5 files changed, 21 insertions, 17 deletions
diff --git a/src/engine/Engine.hpp b/src/engine/Engine.hpp
index e1854a8b..c9e9229e 100644
--- a/src/engine/Engine.hpp
+++ b/src/engine/Engine.hpp
@@ -25,8 +25,7 @@
#include "raul/SharedPtr.hpp"
-#include "ingen/PortType.hpp"
-#include "ingen/EventType.hpp"
+#include "ingen/EngineBase.hpp"
namespace Raul { class Maid; }
@@ -54,7 +53,7 @@ class ProcessContext;
@ingroup engine
*/
-class Engine : public boost::noncopyable
+class Engine : public boost::noncopyable, public EngineBase
{
public:
explicit Engine(Ingen::Shared::World* world);
diff --git a/src/engine/LV2RequestRunFeature.hpp b/src/engine/LV2RequestRunFeature.hpp
index 9f35d506..6d6b66b3 100644
--- a/src/engine/LV2RequestRunFeature.hpp
+++ b/src/engine/LV2RequestRunFeature.hpp
@@ -48,9 +48,10 @@ struct RequestRunFeature : public Shared::LV2Features::Feature {
if (!data->world->local_engine())
return;
- data->world->local_engine()->message_context()->run(
+ Engine* engine = (Engine*)data->world->local_engine().get();
+ engine->message_context()->run(
dynamic_cast<NodeImpl*>(data->node),
- data->world->local_engine()->driver()->frame_time());
+ engine->driver()->frame_time());
}
static void delete_feature(LV2_Feature* feature) {
diff --git a/src/engine/ingen_jack.cpp b/src/engine/ingen_jack.cpp
index 93119bd8..e8645cb9 100644
--- a/src/engine/ingen_jack.cpp
+++ b/src/engine/ingen_jack.cpp
@@ -25,10 +25,11 @@ using namespace Ingen;
struct IngenJackModule : public Ingen::Shared::Module {
void load(Ingen::Shared::World* world) {
- Ingen::JackDriver* driver = new Ingen::JackDriver(*world->local_engine().get());
+ Ingen::JackDriver* driver = new Ingen::JackDriver(
+ *(Engine*)world->local_engine().get());
driver->attach(world->conf()->option("jack-server").get_string(),
world->conf()->option("jack-client").get_string(), NULL);
- world->local_engine()->set_driver(SharedPtr<Driver>(driver));
+ ((Engine*)world->local_engine().get())->set_driver(SharedPtr<Driver>(driver));
}
};
diff --git a/src/engine/ingen_lv2.cpp b/src/engine/ingen_lv2.cpp
index a6f178ff..69daa7ae 100644
--- a/src/engine/ingen_lv2.cpp
+++ b/src/engine/ingen_lv2.cpp
@@ -267,11 +267,12 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
plugin->world->set_local_engine(engine);
SharedPtr<QueuedEngineInterface> interface(
- new Ingen::QueuedEngineInterface(*plugin->world->local_engine(),
- event_queue_size));
+ new Ingen::QueuedEngineInterface(
+ *engine.get(),
+ event_queue_size));
plugin->world->set_engine(interface);
- plugin->world->local_engine()->add_event_source(interface);
+ engine->add_event_source(interface);
Raul::Thread::get().set_context(THREAD_PRE_PROCESS);
ThreadManager::single_threaded = true;
@@ -309,9 +310,9 @@ ingen_instantiate(const LV2_Descriptor* descriptor,
static void
ingen_connect_port(LV2_Handle instance, uint32_t port, void* data)
{
- IngenPlugin* me = (IngenPlugin*)instance;
- SharedPtr<Ingen::Engine> engine = me->world->local_engine();
- Ingen::LV2::LV2Driver* driver = (Ingen::LV2::LV2Driver*)engine->driver();
+ IngenPlugin* me = (IngenPlugin*)instance;
+ Ingen::Engine* engine = (Ingen::Engine*)me->world->local_engine().get();
+ Ingen::LV2::LV2Driver* driver = (Ingen::LV2::LV2Driver*)engine->driver();
if (port < driver->ports().size()) {
driver->ports().at(port)->set_buffer(data);
assert(driver->ports().at(port)->patch_port()->index() == port);
@@ -330,10 +331,11 @@ ingen_activate(LV2_Handle instance)
static void
ingen_run(LV2_Handle instance, uint32_t sample_count)
{
- IngenPlugin* me = (IngenPlugin*)instance;
+ IngenPlugin* me = (IngenPlugin*)instance;
+ Ingen::Engine* engine = (Ingen::Engine*)me->world->local_engine().get();
// FIXME: don't do this every call
Raul::Thread::get().set_context(Ingen::THREAD_PROCESS);
- ((Ingen::LV2::LV2Driver*)me->world->local_engine()->driver())->run(sample_count);
+ ((Ingen::LV2::LV2Driver*)engine->driver())->run(sample_count);
}
static void
diff --git a/src/engine/ingen_osc.cpp b/src/engine/ingen_osc.cpp
index 5e75b756..0a2d6768 100644
--- a/src/engine/ingen_osc.cpp
+++ b/src/engine/ingen_osc.cpp
@@ -27,10 +27,11 @@ using namespace Ingen;
struct IngenOSCModule : public Ingen::Shared::Module {
void load(Ingen::Shared::World* world) {
SharedPtr<OSCEngineReceiver> interface(
- new Ingen::OSCEngineReceiver(*world->local_engine().get(),
+ new Ingen::OSCEngineReceiver(
+ *(Engine*)world->local_engine().get(),
event_queue_size,
world->conf()->option("engine-port").get_int32()));
- world->local_engine()->add_event_source(interface);
+ ((Engine*)world->local_engine().get())->add_event_source(interface);
}
};