summaryrefslogtreecommitdiffstats
path: root/src/engine/Engine.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-29 01:43:54 +0000
committerDavid Robillard <d@drobilla.net>2010-01-29 01:43:54 +0000
commitd5a514148bec58cd7e97d032259362b2e19c0e95 (patch)
tree64ea4dd182a8918b47a6d5f391e2cd097aebb526 /src/engine/Engine.cpp
parent36039b294ee823ceb2c239129defc5eafa110247 (diff)
downloadingen-d5a514148bec58cd7e97d032259362b2e19c0e95.tar.gz
ingen-d5a514148bec58cd7e97d032259362b2e19c0e95.tar.bz2
ingen-d5a514148bec58cd7e97d032259362b2e19c0e95.zip
Magic MIDI binding via special ingen_control port.
Always set lv2:minimum and lv2:maximum properties for control ports so they show up in properties dialog (and can be used for MIDI binding). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2391 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/Engine.cpp')
-rw-r--r--src/engine/Engine.cpp24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp
index 2ca2b03d..437389d3 100644
--- a/src/engine/Engine.cpp
+++ b/src/engine/Engine.cpp
@@ -25,16 +25,19 @@
#include "uri-map.lv2/uri-map.h"
#include "common/interface/EventType.hpp"
#include "events/CreatePatch.hpp"
+#include "events/CreatePort.hpp"
#include "module/World.hpp"
#include "shared/LV2Features.hpp"
#include "shared/LV2URIMap.hpp"
#include "shared/Store.hpp"
-#include "Driver.hpp"
#include "BufferFactory.hpp"
#include "ClientBroadcaster.hpp"
+#include "ControlBindings.hpp"
+#include "Driver.hpp"
#include "Engine.hpp"
#include "EngineStore.hpp"
#include "Event.hpp"
+#include "EventSource.hpp"
#include "MessageContext.hpp"
#include "NodeFactory.hpp"
#include "PatchImpl.hpp"
@@ -43,7 +46,6 @@
#include "ProcessContext.hpp"
#include "ProcessSlave.hpp"
#include "QueuedEngineInterface.hpp"
-#include "EventSource.hpp"
#include "ThreadManager.hpp"
#include "tuning.hpp"
@@ -54,6 +56,7 @@ namespace Ingen {
using namespace Shared;
+bool ThreadManager::single_threaded = true;
Engine::Engine(Ingen::Shared::World* world)
: _world(world)
@@ -64,6 +67,8 @@ Engine::Engine(Ingen::Shared::World* world)
, _message_context(new MessageContext(*this))
, _buffer_factory(new BufferFactory(*this, PtrCast<LV2URIMap>(
world->lv2_features->feature(LV2_URI_MAP_URI))))
+ , _control_bindings(new ControlBindings(*this, PtrCast<LV2URIMap>(
+ world->lv2_features->feature(LV2_URI_MAP_URI))))
, _quit_flag(false)
, _activated(false)
{
@@ -172,6 +177,17 @@ Engine::activate()
_world->store->add(root_patch);
root_patch->compiled_patch(root_patch->compile());
_driver->set_root_patch(root_patch);
+
+ // Add control port
+ Shared::Resource::Properties properties;
+ properties.insert(make_pair("lv2:name", "Control"));
+ Events::CreatePort* ev = new Events::CreatePort(*this, SharedPtr<Responder>(), 0,
+ "/ingen_control", "lv2ev:EventPort", false, NULL, properties);
+ ev->pre_process();
+ ProcessContext context(*this);
+ ev->execute(context);
+ ev->post_process();
+ delete ev;
}
_driver->activate();
@@ -183,9 +199,8 @@ Engine::activate()
root_patch->enable();
- //_post_processor->start();
-
_activated = true;
+ ThreadManager::single_threaded = false;
return true;
}
@@ -204,6 +219,7 @@ Engine::deactivate()
_driver->root_patch()->deactivate();
_activated = false;
+ ThreadManager::single_threaded = true;
}