summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/events/AddNodeEvent.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/engine/events/AddNodeEvent.cpp')
-rw-r--r--src/libs/engine/events/AddNodeEvent.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/libs/engine/events/AddNodeEvent.cpp b/src/libs/engine/events/AddNodeEvent.cpp
index 92214009..b7bc8a66 100644
--- a/src/libs/engine/events/AddNodeEvent.cpp
+++ b/src/libs/engine/events/AddNodeEvent.cpp
@@ -36,13 +36,13 @@ namespace Ingen {
AddNodeEvent::AddNodeEvent(Engine& engine, SharedPtr<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)
+ _path(path),
+ _plugin_uri(plugin_uri),
+ _poly(poly),
+ _patch(NULL),
+ _node(NULL),
+ _process_order(NULL),
+ _node_already_exists(false)
{
}
@@ -54,15 +54,15 @@ AddNodeEvent::AddNodeEvent(Engine& engine, SharedPtr<Responder> responder, Sampl
AddNodeEvent::AddNodeEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path,
const string& plugin_type, const string& plugin_lib, const string& plugin_label, bool poly)
: QueuedEvent(engine, responder, timestamp),
- m_path(path),
- m_plugin_type(plugin_type),
- m_plugin_lib(plugin_lib),
- m_plugin_label(plugin_label),
- m_poly(poly),
- m_patch(NULL),
- m_node(NULL),
- m_process_order(NULL),
- m_node_already_exists(false)
+ _path(path),
+ _plugin_type(plugin_type),
+ _plugin_lib(plugin_lib),
+ _plugin_label(plugin_label),
+ _poly(poly),
+ _patch(NULL),
+ _node(NULL),
+ _process_order(NULL),
+ _node_already_exists(false)
{
}
@@ -70,36 +70,36 @@ AddNodeEvent::AddNodeEvent(Engine& engine, SharedPtr<Responder> responder, Sampl
void
AddNodeEvent::pre_process()
{
- if (_engine.object_store()->find(m_path) != NULL) {
- m_node_already_exists = true;
+ if (_engine.object_store()->find(_path) != NULL) {
+ _node_already_exists = true;
QueuedEvent::pre_process();
return;
}
- m_patch = _engine.object_store()->find_patch(m_path.parent());
+ _patch = _engine.object_store()->find_patch(_path.parent());
- const Plugin* plugin = (m_plugin_uri != "")
- ? _engine.node_factory()->plugin(m_plugin_uri)
- : _engine.node_factory()->plugin(m_plugin_type, m_plugin_lib, m_plugin_label);
+ const Plugin* plugin = (_plugin_uri != "")
+ ? _engine.node_factory()->plugin(_plugin_uri)
+ : _engine.node_factory()->plugin(_plugin_type, _plugin_lib, _plugin_label);
- if (m_patch && plugin) {
- if (m_poly)
- m_node = _engine.node_factory()->load_plugin(plugin, m_path.name(), m_patch->internal_poly(), m_patch);
+ if (_patch && plugin) {
+ if (_poly)
+ _node = _engine.node_factory()->load_plugin(plugin, _path.name(), _patch->internal_poly(), _patch);
else
- m_node = _engine.node_factory()->load_plugin(plugin, m_path.name(), 1, m_patch);
+ _node = _engine.node_factory()->load_plugin(plugin, _path.name(), 1, _patch);
- if (m_node != NULL) {
- m_node->activate();
+ if (_node != NULL) {
+ _node->activate();
// This can be done here because the audio thread doesn't touch the
// node tree - just the process order array
- m_patch->add_node(new ListNode<Node*>(m_node));
- m_node->add_to_store(_engine.object_store());
+ _patch->add_node(new ListNode<Node*>(_node));
+ _node->add_to_store(_engine.object_store());
// FIXME: not really necessary to build process order since it's not connected,
// just append to the list
- if (m_patch->enabled())
- m_process_order = m_patch->build_process_order();
+ if (_patch->enabled())
+ _process_order = _patch->build_process_order();
}
}
QueuedEvent::pre_process();
@@ -111,10 +111,10 @@ AddNodeEvent::execute(SampleCount nframes, FrameTime start, FrameTime end)
{
QueuedEvent::execute(nframes, start, end);
- if (m_node != NULL) {
- if (m_patch->process_order() != NULL)
- _engine.maid()->push(m_patch->process_order());
- m_patch->process_order(m_process_order);
+ if (_node != NULL) {
+ if (_patch->process_order() != NULL)
+ _engine.maid()->push(_patch->process_order());
+ _patch->process_order(_process_order);
}
}
@@ -123,20 +123,20 @@ void
AddNodeEvent::post_process()
{
string msg;
- if (m_node_already_exists) {
- msg = string("Could not create node - ").append(m_path);// + " already exists.";
+ if (_node_already_exists) {
+ msg = string("Could not create node - ").append(_path);// + " already exists.";
_responder->respond_error(msg);
- } else if (m_patch == NULL) {
- msg = "Could not find patch '" + m_path.parent() +"' for add_node.";
+ } else if (_patch == NULL) {
+ msg = "Could not find patch '" + _path.parent() +"' for add_node.";
_responder->respond_error(msg);
- } else if (m_node == NULL) {
+ } else if (_node == NULL) {
msg = "Unable to load node ";
- msg.append(m_path).append(" (you're missing the plugin \"").append(
- m_plugin_uri);
+ msg.append(_path).append(" (you're missing the plugin \"").append(
+ _plugin_uri);
_responder->respond_error(msg);
} else {
_responder->respond_ok();
- _engine.broadcaster()->send_node(m_node, true); // yes, send ports
+ _engine.broadcaster()->send_node(_node, true); // yes, send ports
}
}