From e9d99340c9ac29aaa7912db0554a88820c4a776a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 22 Oct 2007 03:48:28 +0000 Subject: Rework plugin design (engine side) to be less crap. Use LADSPA labels instead of munged friendly names to generate OSC paths. Separate OSC paths/names from human friendly names (conceptually, still needs UI exposing). git-svn-id: http://svn.drobilla.net/lad/ingen@898 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/events/CreateNodeEvent.cpp | 15 ++++++++++----- src/libs/engine/events/CreateNodeEvent.hpp | 2 +- src/libs/engine/events/MidiLearnEvent.cpp | 2 +- src/libs/engine/events/NoteEvent.cpp | 8 ++++---- src/libs/engine/events/RequestPluginEvent.cpp | 2 +- 5 files changed, 17 insertions(+), 12 deletions(-) (limited to 'src/libs/engine/events') 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 #include #include +#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, 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, * Do not use. */ CreateNodeEvent::CreateNodeEvent(Engine& engine, SharedPtr 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."); -- cgit v1.2.1