summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine/events')
-rw-r--r--src/libs/engine/events/CreateNodeEvent.cpp15
-rw-r--r--src/libs/engine/events/CreateNodeEvent.hpp2
-rw-r--r--src/libs/engine/events/MidiLearnEvent.cpp2
-rw-r--r--src/libs/engine/events/NoteEvent.cpp8
-rw-r--r--src/libs/engine/events/RequestPluginEvent.cpp2
5 files changed, 17 insertions, 12 deletions
diff --git a/src/libs/engine/events/CreateNodeEvent.cpp b/src/libs/engine/events/CreateNodeEvent.cpp
index dea1024b..ab9c6eaf 100644
--- a/src/libs/engine/events/CreateNodeEvent.cpp
+++ b/src/libs/engine/events/CreateNodeEvent.cpp
@@ -18,6 +18,7 @@
#include <raul/Maid.hpp>
#include <raul/Path.hpp>
#include <raul/Path.hpp>
+#include "module/World.hpp"
#include "CreateNodeEvent.hpp"
#include "Responder.hpp"
#include "PatchImpl.hpp"
@@ -29,16 +30,17 @@
#include "ClientBroadcaster.hpp"
#include "ObjectStore.hpp"
#include "PortImpl.hpp"
+#include "AudioDriver.hpp"
namespace Ingen {
CreateNodeEvent::CreateNodeEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path,
- const string& plugin_uri, bool poly)
+ const string& plugin_uri, bool polyphonic)
: QueuedEvent(engine, responder, timestamp),
_path(path),
_plugin_uri(plugin_uri),
- _poly(poly),
+ _polyphonic(polyphonic),
_patch(NULL),
_node(NULL),
_compiled_patch(NULL),
@@ -52,13 +54,13 @@ CreateNodeEvent::CreateNodeEvent(Engine& engine, SharedPtr<Responder> responder,
* Do not use.
*/
CreateNodeEvent::CreateNodeEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path,
- const string& plugin_type, const string& plugin_lib, const string& plugin_label, bool poly)
+ const string& plugin_type, const string& plugin_lib, const string& plugin_label, bool polyphonic)
: QueuedEvent(engine, responder, timestamp),
_path(path),
_plugin_type(plugin_type),
_plugin_lib(plugin_lib),
_plugin_label(plugin_label),
- _poly(poly),
+ _polyphonic(polyphonic),
_patch(NULL),
_node(NULL),
_compiled_patch(NULL),
@@ -84,7 +86,10 @@ CreateNodeEvent::pre_process()
if (_patch && plugin) {
- _node = _engine.node_factory()->load_plugin(plugin, _path.name(), _poly, _patch);
+ Glib::Mutex::Lock lock(_engine.world()->rdf_world->mutex());
+
+ _node = plugin->instantiate(_path.name(), _polyphonic, _patch,
+ _engine.audio_driver()->sample_rate(), _engine.audio_driver()->buffer_size());
if (_node != NULL) {
_node->activate();
diff --git a/src/libs/engine/events/CreateNodeEvent.hpp b/src/libs/engine/events/CreateNodeEvent.hpp
index 6c3f2a94..c3ef6313 100644
--- a/src/libs/engine/events/CreateNodeEvent.hpp
+++ b/src/libs/engine/events/CreateNodeEvent.hpp
@@ -68,7 +68,7 @@ private:
string _plugin_type;
string _plugin_lib;
string _plugin_label;
- bool _poly;
+ bool _polyphonic;
PatchImpl* _patch;
NodeImpl* _node;
CompiledPatch* _compiled_patch; ///< Patch's new process order
diff --git a/src/libs/engine/events/MidiLearnEvent.cpp b/src/libs/engine/events/MidiLearnEvent.cpp
index c2f2c4e5..8d5b0658 100644
--- a/src/libs/engine/events/MidiLearnEvent.cpp
+++ b/src/libs/engine/events/MidiLearnEvent.cpp
@@ -65,7 +65,7 @@ MidiLearnEvent::execute(ProcessContext& context)
// FIXME: this isn't very good at all.
if (_node != NULL && _node->plugin_impl()->type() == Plugin::Internal
- && _node->plugin_impl()->plug_label() == "midi_control_in") {
+ && _node->plugin_impl()->uri() == "ingen:control_node") {
((MidiControlNode*)_node)->learn(_response_event);
}
}
diff --git a/src/libs/engine/events/NoteEvent.cpp b/src/libs/engine/events/NoteEvent.cpp
index fb0347af..ff96e94c 100644
--- a/src/libs/engine/events/NoteEvent.cpp
+++ b/src/libs/engine/events/NoteEvent.cpp
@@ -71,14 +71,14 @@ NoteEvent::execute(ProcessContext& context)
if (_node != NULL && _node->plugin()->type() == Plugin::Internal) {
if (_on) {
- if (_node->plugin_impl()->plug_label() == "note_in")
+ if (_node->plugin_impl()->uri() == "ingen:note_node")
((MidiNoteNode*)_node)->note_on(_note_num, _velocity, _time, context);
- else if (_node->plugin_impl()->plug_label() == "trigger_in")
+ else if (_node->plugin_impl()->uri() == "ingen:trigger_node")
((MidiTriggerNode*)_node)->note_on(_note_num, _velocity, _time, context);
} else {
- if (_node->plugin_impl()->plug_label() == "note_in")
+ if (_node->plugin_impl()->uri() == "ingen:note_node")
((MidiNoteNode*)_node)->note_off(_note_num, _time, context);
- else if (_node->plugin_impl()->plug_label() == "trigger_in")
+ else if (_node->plugin_impl()->uri() == "ingen:trigger_node")
((MidiTriggerNode*)_node)->note_off(_note_num, _time, context);
}
}
diff --git a/src/libs/engine/events/RequestPluginEvent.cpp b/src/libs/engine/events/RequestPluginEvent.cpp
index 21ad97d4..1c1df99e 100644
--- a/src/libs/engine/events/RequestPluginEvent.cpp
+++ b/src/libs/engine/events/RequestPluginEvent.cpp
@@ -67,7 +67,7 @@ RequestPluginEvent::post_process()
_responder->respond_ok();
assert(_plugin->uri() == _uri);
- _responder->client()->new_plugin(_uri, _plugin->type_uri(), _plugin->name());
+ _responder->client()->new_plugin(_uri, _plugin->type_uri(), _plugin->symbol(), _plugin->name());
} else {
_responder->respond_error("Unable to find client to send plugin.");