summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/AddNodeEvent.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-09-14 02:27:02 +0000
committerDavid Robillard <d@drobilla.net>2006-09-14 02:27:02 +0000
commitcc384f6f622cc10fd83616256080b80dc2123aaf (patch)
tree9a5f0d7f14e04ad7effcda8be6b5924b4d61e361 /src/libs/engine/events/AddNodeEvent.cpp
parent5525b33b79b7a920cf374704e67fc6b16fe5f77c (diff)
downloadingen-cc384f6f622cc10fd83616256080b80dc2123aaf.tar.gz
ingen-cc384f6f622cc10fd83616256080b80dc2123aaf.tar.bz2
ingen-cc384f6f622cc10fd83616256080b80dc2123aaf.zip
Cleaned up client-side model code significantly (made everything private
so only Store can change the state of models). Extremely broken, just committing to move code between machines :). git-svn-id: http://svn.drobilla.net/lad/ingen@133 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events/AddNodeEvent.cpp')
-rw-r--r--src/libs/engine/events/AddNodeEvent.cpp25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/libs/engine/events/AddNodeEvent.cpp b/src/libs/engine/events/AddNodeEvent.cpp
index 19ff6bf5..6e42ef82 100644
--- a/src/libs/engine/events/AddNodeEvent.cpp
+++ b/src/libs/engine/events/AddNodeEvent.cpp
@@ -33,7 +33,7 @@
namespace Ingen {
-AddNodeEvent::AddNodeEvent(Engine& engine, CountedPtr<Responder> responder, SampleCount timestamp, const string& path, Plugin* plugin, bool poly)
+/*AddNodeEvent::AddNodeEvent(Engine& engine, CountedPtr<Responder> responder, SampleCount timestamp, const string& path, Plugin* plugin, bool poly)
: QueuedEvent(engine, responder, timestamp),
m_path(path),
m_plugin(plugin),
@@ -43,12 +43,24 @@ AddNodeEvent::AddNodeEvent(Engine& engine, CountedPtr<Responder> responder, Samp
m_process_order(NULL),
m_node_already_exists(false)
{
+}*/
+
+AddNodeEvent::AddNodeEvent(Engine& engine, CountedPtr<Responder> responder, SampleCount timestamp, const string& path,
+ const string& plugin_uri, bool poly)
+: QueuedEvent(engine, responder, timestamp),
+ m_path(path),
+ m_plugin_uri(plugin_uri),
+ m_poly(poly),
+ m_patch(NULL),
+ m_node(NULL),
+ m_process_order(NULL),
+ m_node_already_exists(false)
+{
}
AddNodeEvent::~AddNodeEvent()
{
- delete m_plugin;
}
@@ -62,12 +74,13 @@ AddNodeEvent::pre_process()
}
m_patch = _engine.object_store()->find_patch(m_path.parent());
+ const Plugin* plugin = _engine.node_factory()->plugin(m_plugin_uri);
- if (m_patch != NULL) {
+ if (m_patch && plugin) {
if (m_poly)
- m_node = _engine.node_factory()->load_plugin(m_plugin, m_path.name(), m_patch->internal_poly(), m_patch);
+ m_node = _engine.node_factory()->load_plugin(plugin, m_path.name(), m_patch->internal_poly(), m_patch);
else
- m_node = _engine.node_factory()->load_plugin(m_plugin, m_path.name(), 1, m_patch);
+ m_node = _engine.node_factory()->load_plugin(plugin, m_path.name(), 1, m_patch);
if (m_node != NULL) {
m_node->activate();
@@ -113,7 +126,7 @@ AddNodeEvent::post_process()
} else if (m_node == NULL) {
msg = "Unable to load node ";
msg.append(m_path).append(" (you're missing the plugin \"").append(
- m_plugin->uri());
+ m_plugin_uri);
_responder->respond_error(msg);
} else {
_responder->respond_ok();