diff options
author | David Robillard <d@drobilla.net> | 2007-02-07 03:22:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-02-07 03:22:42 +0000 |
commit | 39d5400b39c8089287d5d294becae1268d232d31 (patch) | |
tree | 0cf73ef86233121bc7f0408ca536aad196d3166c /src/libs/engine/events | |
parent | e135edf1e65ac978f86f4849bd3667299dd69c7e (diff) | |
download | ingen-39d5400b39c8089287d5d294becae1268d232d31.tar.gz ingen-39d5400b39c8089287d5d294becae1268d232d31.tar.bz2 ingen-39d5400b39c8089287d5d294becae1268d232d31.zip |
Mad sed-fu for consistent private member naming.
git-svn-id: http://svn.drobilla.net/lad/ingen@286 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/events')
54 files changed, 714 insertions, 714 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 } } diff --git a/src/libs/engine/events/AddNodeEvent.h b/src/libs/engine/events/AddNodeEvent.h index b4d7b0ba..23274a23 100644 --- a/src/libs/engine/events/AddNodeEvent.h +++ b/src/libs/engine/events/AddNodeEvent.h @@ -61,17 +61,17 @@ public: void post_process(); private: - string m_patch_name; - Path m_path; - string m_plugin_uri; ///< If nonempty then type, library, label, are ignored - string m_plugin_type; - string m_plugin_lib; - string m_plugin_label; - bool m_poly; - Patch* m_patch; - Node* m_node; - Array<Node*>* m_process_order; ///< Patch's new process order - bool m_node_already_exists; + string _patch_name; + Path _path; + string _plugin_uri; ///< If nonempty then type, library, label, are ignored + string _plugin_type; + string _plugin_lib; + string _plugin_label; + bool _poly; + Patch* _patch; + Node* _node; + Array<Node*>* _process_order; ///< Patch's new process order + bool _node_already_exists; }; diff --git a/src/libs/engine/events/AllNotesOffEvent.cpp b/src/libs/engine/events/AllNotesOffEvent.cpp index c90b1e45..25e647c9 100644 --- a/src/libs/engine/events/AllNotesOffEvent.cpp +++ b/src/libs/engine/events/AllNotesOffEvent.cpp @@ -26,7 +26,7 @@ namespace Ingen { */ AllNotesOffEvent::AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, Patch* patch) : Event(engine, responder, timestamp), - m_patch(patch) + _patch(patch) { } @@ -35,8 +35,8 @@ AllNotesOffEvent::AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responde */ AllNotesOffEvent::AllNotesOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& patch_path) : Event(engine, responder, timestamp), - m_patch(NULL), - m_patch_path(patch_path) + _patch(NULL), + _patch_path(patch_path) { } @@ -46,11 +46,11 @@ AllNotesOffEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { Event::execute(nframes, start, end); - if (m_patch == NULL && m_patch_path != "") - m_patch = _engine.object_store()->find_patch(m_patch_path); + if (_patch == NULL && _patch_path != "") + _patch = _engine.object_store()->find_patch(_patch_path); - //if (m_patch != NULL) - // for (List<MidiInNode*>::iterator j = m_patch->midi_in_nodes().begin(); j != m_patch->midi_in_nodes().end(); ++j) + //if (_patch != NULL) + // for (List<MidiInNode*>::iterator j = _patch->midi_in_nodes().begin(); j != _patch->midi_in_nodes().end(); ++j) // (*j)->all_notes_off(offset); } @@ -58,7 +58,7 @@ AllNotesOffEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void AllNotesOffEvent::post_process() { - if (m_patch != NULL) + if (_patch != NULL) _responder->respond_ok(); } diff --git a/src/libs/engine/events/AllNotesOffEvent.h b/src/libs/engine/events/AllNotesOffEvent.h index 53b8f158..a5264a6f 100644 --- a/src/libs/engine/events/AllNotesOffEvent.h +++ b/src/libs/engine/events/AllNotesOffEvent.h @@ -40,8 +40,8 @@ public: void post_process(); private: - Patch* m_patch; - string m_patch_path; + Patch* _patch; + string _patch_path; }; diff --git a/src/libs/engine/events/ClearPatchEvent.cpp b/src/libs/engine/events/ClearPatchEvent.cpp index db2ea54b..2e59ab5a 100644 --- a/src/libs/engine/events/ClearPatchEvent.cpp +++ b/src/libs/engine/events/ClearPatchEvent.cpp @@ -32,9 +32,9 @@ namespace Ingen { ClearPatchEvent::ClearPatchEvent(Engine& engine, SharedPtr<Responder> responder, FrameTime time, QueuedEventSource* source, const string& patch_path) : QueuedEvent(engine, responder, time, true, source), - m_patch_path(patch_path), - m_patch(NULL), - m_process(false) + _patch_path(patch_path), + _patch(NULL), + _process(false) { } @@ -42,13 +42,13 @@ ClearPatchEvent::ClearPatchEvent(Engine& engine, SharedPtr<Responder> responder, void ClearPatchEvent::pre_process() { - m_patch = _engine.object_store()->find_patch(m_patch_path); + _patch = _engine.object_store()->find_patch(_patch_path); - if (m_patch != NULL) { + if (_patch != NULL) { - m_process = m_patch->enabled(); + _process = _patch->enabled(); - for (List<Node*>::const_iterator i = m_patch->nodes().begin(); i != m_patch->nodes().end(); ++i) + for (List<Node*>::const_iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) (*i)->remove_from_store(); } @@ -61,16 +61,16 @@ ClearPatchEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_patch != NULL) { - m_patch->disable(); + if (_patch != NULL) { + _patch->disable(); cerr << "FIXME: CLEAR PATCH\n"; - //for (List<Node*>::const_iterator i = m_patch->nodes().begin(); i != m_patch->nodes().end(); ++i) + //for (List<Node*>::const_iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) // (*i)->remove_from_patch(); - if (m_patch->process_order() != NULL) { - _engine.maid()->push(m_patch->process_order()); - m_patch->process_order(NULL); + if (_patch->process_order() != NULL) { + _engine.maid()->push(_patch->process_order()); + _patch->process_order(NULL); } } } @@ -79,34 +79,34 @@ ClearPatchEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void ClearPatchEvent::post_process() { - if (m_patch != NULL) { + if (_patch != NULL) { // Delete all nodes - for (List<Node*>::iterator i = m_patch->nodes().begin(); i != m_patch->nodes().end(); ++i) { + for (List<Node*>::iterator i = _patch->nodes().begin(); i != _patch->nodes().end(); ++i) { (*i)->deactivate(); delete *i; } - m_patch->nodes().clear(); + _patch->nodes().clear(); // Delete all connections - for (List<Connection*>::iterator i = m_patch->connections().begin(); i != m_patch->connections().end(); ++i) + for (List<Connection*>::iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) delete *i; - m_patch->connections().clear(); + _patch->connections().clear(); // Restore patch's run state - if (m_process) - m_patch->enable(); + if (_process) + _patch->enable(); else - m_patch->disable(); + _patch->disable(); // Make sure everything's sane - assert(m_patch->nodes().size() == 0); - assert(m_patch->connections().size() == 0); + assert(_patch->nodes().size() == 0); + assert(_patch->connections().size() == 0); // Reply _responder->respond_ok(); - _engine.broadcaster()->send_patch_cleared(m_patch_path); + _engine.broadcaster()->send_patch_cleared(_patch_path); } else { - _responder->respond_error(string("Patch ") + m_patch_path + " not found"); + _responder->respond_error(string("Patch ") + _patch_path + " not found"); } _source->unblock(); diff --git a/src/libs/engine/events/ClearPatchEvent.h b/src/libs/engine/events/ClearPatchEvent.h index 0ed9294b..37f1ab11 100644 --- a/src/libs/engine/events/ClearPatchEvent.h +++ b/src/libs/engine/events/ClearPatchEvent.h @@ -42,9 +42,9 @@ public: void post_process(); private: - string m_patch_path; - Patch* m_patch; - bool m_process; + string _patch_path; + Patch* _patch; + bool _process; }; diff --git a/src/libs/engine/events/ConnectionEvent.cpp b/src/libs/engine/events/ConnectionEvent.cpp index c54e440f..40e8a660 100644 --- a/src/libs/engine/events/ConnectionEvent.cpp +++ b/src/libs/engine/events/ConnectionEvent.cpp @@ -38,86 +38,86 @@ namespace Ingen { ConnectionEvent::ConnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& src_port_path, const string& dst_port_path) : QueuedEvent(engine, responder, timestamp), - m_src_port_path(src_port_path), - m_dst_port_path(dst_port_path), - m_patch(NULL), - m_src_port(NULL), - m_dst_port(NULL), - m_typed_event(NULL), - m_error(NO_ERROR) + _src_port_path(src_port_path), + _dst_port_path(dst_port_path), + _patch(NULL), + _src_port(NULL), + _dst_port(NULL), + _typed_event(NULL), + _error(NO_ERROR) { } ConnectionEvent::~ConnectionEvent() { - delete m_typed_event; + delete _typed_event; } void ConnectionEvent::pre_process() { - if (m_src_port_path.parent().parent() != m_dst_port_path.parent().parent() - && m_src_port_path.parent() != m_dst_port_path.parent().parent() - && m_src_port_path.parent().parent() != m_dst_port_path.parent()) { - m_error = PARENT_PATCH_DIFFERENT; + if (_src_port_path.parent().parent() != _dst_port_path.parent().parent() + && _src_port_path.parent() != _dst_port_path.parent().parent() + && _src_port_path.parent().parent() != _dst_port_path.parent()) { + _error = PARENT_PATCH_DIFFERENT; QueuedEvent::pre_process(); return; } - /*m_patch = _engine.object_store()->find_patch(m_src_port_path.parent().parent()); + /*_patch = _engine.object_store()->find_patch(_src_port_path.parent().parent()); - if (m_patch == NULL) { - m_error = PORT_NOT_FOUND; + if (_patch == NULL) { + _error = PORT_NOT_FOUND; QueuedEvent::pre_process(); return; }*/ - m_src_port = _engine.object_store()->find_port(m_src_port_path); - m_dst_port = _engine.object_store()->find_port(m_dst_port_path); + _src_port = _engine.object_store()->find_port(_src_port_path); + _dst_port = _engine.object_store()->find_port(_dst_port_path); - if (m_src_port == NULL || m_dst_port == NULL) { - m_error = PORT_NOT_FOUND; + if (_src_port == NULL || _dst_port == NULL) { + _error = PORT_NOT_FOUND; QueuedEvent::pre_process(); return; } - if (m_src_port->type() != m_dst_port->type() || m_src_port->buffer_size() != m_dst_port->buffer_size()) { - m_error = TYPE_MISMATCH; + if (_src_port->type() != _dst_port->type() || _src_port->buffer_size() != _dst_port->buffer_size()) { + _error = TYPE_MISMATCH; QueuedEvent::pre_process(); return; } /*if (port1->is_output() && port2->is_input()) { - m_src_port = port1; - m_dst_port = port2; + _src_port = port1; + _dst_port = port2; } else if (port2->is_output() && port1->is_input()) { - m_src_port = port2; - m_dst_port = port1; + _src_port = port2; + _dst_port = port1; } else { - m_error = TYPE_MISMATCH; + _error = TYPE_MISMATCH; QueuedEvent::pre_process(); return; }*/ // Create the typed event to actually do the work - const DataType type = m_src_port->type(); + const DataType type = _src_port->type(); if (type == DataType::FLOAT) { - m_typed_event = new TypedConnectionEvent<Sample>(_engine, _responder, _time, - dynamic_cast<OutputPort<Sample>*>(m_src_port), dynamic_cast<InputPort<Sample>*>(m_dst_port)); + _typed_event = new TypedConnectionEvent<Sample>(_engine, _responder, _time, + dynamic_cast<OutputPort<Sample>*>(_src_port), dynamic_cast<InputPort<Sample>*>(_dst_port)); } else if (type == DataType::MIDI) { - m_typed_event = new TypedConnectionEvent<MidiMessage>(_engine, _responder, _time, - dynamic_cast<OutputPort<MidiMessage>*>(m_src_port), dynamic_cast<InputPort<MidiMessage>*>(m_dst_port)); + _typed_event = new TypedConnectionEvent<MidiMessage>(_engine, _responder, _time, + dynamic_cast<OutputPort<MidiMessage>*>(_src_port), dynamic_cast<InputPort<MidiMessage>*>(_dst_port)); } else { - m_error = TYPE_MISMATCH; + _error = TYPE_MISMATCH; QueuedEvent::pre_process(); return; } - assert(m_typed_event); - m_typed_event->pre_process(); - assert(m_typed_event->is_prepared()); + assert(_typed_event); + _typed_event->pre_process(); + assert(_typed_event->is_prepared()); QueuedEvent::pre_process(); } @@ -128,20 +128,20 @@ ConnectionEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_error == NO_ERROR) - m_typed_event->execute(nframes, start, end); + if (_error == NO_ERROR) + _typed_event->execute(nframes, start, end); } void ConnectionEvent::post_process() { - if (m_error == NO_ERROR) { - m_typed_event->post_process(); + if (_error == NO_ERROR) { + _typed_event->post_process(); } else { // FIXME: better error messages string msg = "Unable to make connection "; - msg.append(m_src_port_path + " -> " + m_dst_port_path); + msg.append(_src_port_path + " -> " + _dst_port_path); _responder->respond_error(msg); } } @@ -154,13 +154,13 @@ ConnectionEvent::post_process() template <typename T> TypedConnectionEvent<T>::TypedConnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, OutputPort<T>* src_port, InputPort<T>* dst_port) : QueuedEvent(engine, responder, timestamp), - m_src_port(src_port), - m_dst_port(dst_port), - m_patch(NULL), - m_process_order(NULL), - m_connection(NULL), - m_port_listnode(NULL), - m_succeeded(true) + _src_port(src_port), + _dst_port(dst_port), + _patch(NULL), + _process_order(NULL), + _connection(NULL), + _port_listnode(NULL), + _succeeded(true) { assert(src_port != NULL); assert(dst_port != NULL); @@ -171,50 +171,50 @@ template <typename T> void TypedConnectionEvent<T>::pre_process() { - if (m_dst_port->is_connected_to(m_src_port)) { - m_succeeded = false; + if (_dst_port->is_connected_to(_src_port)) { + _succeeded = false; QueuedEvent::pre_process(); return; } - Node* const src_node = m_src_port->parent_node(); - Node* const dst_node = m_dst_port->parent_node(); + Node* const src_node = _src_port->parent_node(); + Node* const dst_node = _dst_port->parent_node(); // Connection to a patch port from inside the patch if (src_node->parent_patch() != dst_node->parent_patch()) { assert(src_node->parent() == dst_node || dst_node->parent() == src_node); if (src_node->parent() == dst_node) - m_patch = dynamic_cast<Patch*>(dst_node); + _patch = dynamic_cast<Patch*>(dst_node); else - m_patch = dynamic_cast<Patch*>(src_node); + _patch = dynamic_cast<Patch*>(src_node); // Connection from a patch input to a patch output (pass through) } else if (src_node == dst_node && dynamic_cast<Patch*>(src_node)) { - m_patch = dynamic_cast<Patch*>(src_node); + _patch = dynamic_cast<Patch*>(src_node); // Normal connection between nodes with the same parent } else { - m_patch = src_node->parent_patch(); + _patch = src_node->parent_patch(); } - assert(m_patch); + assert(_patch); if (src_node == NULL || dst_node == NULL) { - m_succeeded = false; + _succeeded = false; QueuedEvent::pre_process(); return; } - if (m_patch != src_node && src_node->parent() != m_patch && dst_node->parent() != m_patch) { - m_succeeded = false; + if (_patch != src_node && src_node->parent() != _patch && dst_node->parent() != _patch) { + _succeeded = false; QueuedEvent::pre_process(); return; } - m_connection = new TypedConnection<T>(m_src_port, m_dst_port); - m_port_listnode = new ListNode<TypedConnection<T>*>(m_connection); - m_patch_listnode = new ListNode<Connection*>(m_connection); + _connection = new TypedConnection<T>(_src_port, _dst_port); + _port_listnode = new ListNode<TypedConnection<T>*>(_connection); + _patch_listnode = new ListNode<Connection*>(_connection); // Need to be careful about patch port connections here and adding a node's // parent as a dependant/provider, or adding a patch as it's own provider... @@ -223,10 +223,10 @@ TypedConnectionEvent<T>::pre_process() src_node->dependants()->push_back(new ListNode<Node*>(dst_node)); } - if (m_patch->enabled()) - m_process_order = m_patch->build_process_order(); + if (_patch->enabled()) + _process_order = _patch->build_process_order(); - m_succeeded = true; + _succeeded = true; QueuedEvent::pre_process(); } @@ -237,13 +237,13 @@ TypedConnectionEvent<T>::execute(SampleCount nframes, FrameTime start, FrameTime { QueuedEvent::execute(nframes, start, end); - if (m_succeeded) { + if (_succeeded) { // These must be inserted here, since they're actually used by the audio thread - m_dst_port->add_connection(m_port_listnode); - m_patch->add_connection(m_patch_listnode); - if (m_patch->process_order() != NULL) - _engine.maid()->push(m_patch->process_order()); - m_patch->process_order(m_process_order); + _dst_port->add_connection(_port_listnode); + _patch->add_connection(_patch_listnode); + if (_patch->process_order() != NULL) + _engine.maid()->push(_patch->process_order()); + _patch->process_order(_process_order); } } @@ -252,12 +252,12 @@ template <typename T> void TypedConnectionEvent<T>::post_process() { - if (m_succeeded) { - assert(m_connection != NULL); + if (_succeeded) { + assert(_connection != NULL); _responder->respond_ok(); - _engine.broadcaster()->send_connection(m_connection); + _engine.broadcaster()->send_connection(_connection); } else { _responder->respond_error("Unable to make connection."); } diff --git a/src/libs/engine/events/ConnectionEvent.h b/src/libs/engine/events/ConnectionEvent.h index 6e4f11b4..0b55994b 100644 --- a/src/libs/engine/events/ConnectionEvent.h +++ b/src/libs/engine/events/ConnectionEvent.h @@ -57,16 +57,16 @@ private: enum ErrorType { NO_ERROR, PARENT_PATCH_DIFFERENT, PORT_NOT_FOUND, TYPE_MISMATCH }; - Raul::Path m_src_port_path; - Raul::Path m_dst_port_path; + Raul::Path _src_port_path; + Raul::Path _dst_port_path; - Patch* m_patch; - Port* m_src_port; - Port* m_dst_port; + Patch* _patch; + Port* _src_port; + Port* _dst_port; - QueuedEvent* m_typed_event; + QueuedEvent* _typed_event; - ErrorType m_error; + ErrorType _error; }; @@ -87,16 +87,16 @@ public: void post_process(); private: - OutputPort<T>* m_src_port; - InputPort<T>* m_dst_port; - - Patch* m_patch; - Array<Node*>* m_process_order; ///< New process order for Patch - TypedConnection<T>* m_connection; - ListNode<Connection*>* m_patch_listnode; - ListNode<TypedConnection<T>*>* m_port_listnode; + OutputPort<T>* _src_port; + InputPort<T>* _dst_port; + + Patch* _patch; + Array<Node*>* _process_order; ///< New process order for Patch + TypedConnection<T>* _connection; + ListNode<Connection*>* _patch_listnode; + ListNode<TypedConnection<T>*>* _port_listnode; - bool m_succeeded; + bool _succeeded; }; diff --git a/src/libs/engine/events/CreatePatchEvent.cpp b/src/libs/engine/events/CreatePatchEvent.cpp index 73813dbb..14fb6693 100644 --- a/src/libs/engine/events/CreatePatchEvent.cpp +++ b/src/libs/engine/events/CreatePatchEvent.cpp @@ -32,12 +32,12 @@ namespace Ingen { CreatePatchEvent::CreatePatchEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path, int poly) : QueuedEvent(engine, responder, timestamp), - m_path(path), - m_patch(NULL), - m_parent(NULL), - m_process_order(NULL), - m_poly(poly), - m_error(NO_ERROR) + _path(path), + _patch(NULL), + _parent(NULL), + _process_order(NULL), + _poly(poly), + _error(NO_ERROR) { } @@ -45,42 +45,42 @@ CreatePatchEvent::CreatePatchEvent(Engine& engine, SharedPtr<Responder> responde void CreatePatchEvent::pre_process() { - if (m_path == "/" || _engine.object_store()->find(m_path) != NULL) { - m_error = OBJECT_EXISTS; + if (_path == "/" || _engine.object_store()->find(_path) != NULL) { + _error = OBJECT_EXISTS; QueuedEvent::pre_process(); return; } - if (m_poly < 1) { - m_error = INVALID_POLY; + if (_poly < 1) { + _error = INVALID_POLY; QueuedEvent::pre_process(); return; } - m_parent = _engine.object_store()->find_patch(m_path.parent()); - if (m_parent == NULL) { - m_error = PARENT_NOT_FOUND; + _parent = _engine.object_store()->find_patch(_path.parent()); + if (_parent == NULL) { + _error = PARENT_NOT_FOUND; QueuedEvent::pre_process(); return; } size_t poly = 1; - if (m_parent != NULL && m_poly > 1 && m_poly == static_cast<int>(m_parent->internal_poly())) - poly = m_poly; + if (_parent != NULL && _poly > 1 && _poly == static_cast<int>(_parent->internal_poly())) + poly = _poly; - m_patch = new Patch(m_path.name(), poly, m_parent, _engine.audio_driver()->sample_rate(), _engine.audio_driver()->buffer_size(), m_poly); + _patch = new Patch(_path.name(), poly, _parent, _engine.audio_driver()->sample_rate(), _engine.audio_driver()->buffer_size(), _poly); - if (m_parent != NULL) { - m_parent->add_node(new ListNode<Node*>(m_patch)); + if (_parent != NULL) { + _parent->add_node(new ListNode<Node*>(_patch)); - if (m_parent->enabled()) - m_process_order = m_parent->build_process_order(); + if (_parent->enabled()) + _process_order = _parent->build_process_order(); } - m_patch->activate(); + _patch->activate(); // Insert into ObjectStore - m_patch->add_to_store(_engine.object_store()); + _patch->add_to_store(_engine.object_store()); QueuedEvent::pre_process(); } @@ -91,18 +91,18 @@ CreatePatchEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_patch != NULL) { - if (m_parent == NULL) { - assert(m_path == "/"); - assert(m_patch->parent_patch() == NULL); - _engine.audio_driver()->set_root_patch(m_patch); + if (_patch != NULL) { + if (_parent == NULL) { + assert(_path == "/"); + assert(_patch->parent_patch() == NULL); + _engine.audio_driver()->set_root_patch(_patch); } else { - assert(m_parent != NULL); - assert(m_path != "/"); + assert(_parent != NULL); + assert(_path != "/"); - if (m_parent->process_order() != NULL) - _engine.maid()->push(m_parent->process_order()); - m_parent->process_order(m_process_order); + if (_parent->process_order() != NULL) + _engine.maid()->push(_parent->process_order()); + _parent->process_order(_process_order); } } } @@ -112,25 +112,25 @@ void CreatePatchEvent::post_process() { if (_responder.get()) { - if (m_error == NO_ERROR) { + if (_error == NO_ERROR) { _responder->respond_ok(); // Don't send ports/nodes that have been added since prepare() // (otherwise they would be sent twice) - _engine.broadcaster()->send_patch(m_patch, false); + _engine.broadcaster()->send_patch(_patch, false); - } else if (m_error == OBJECT_EXISTS) { + } else if (_error == OBJECT_EXISTS) { string msg = "Unable to create patch: "; - msg += m_path += " already exists."; + msg += _path += " already exists."; _responder->respond_error(msg); - } else if (m_error == PARENT_NOT_FOUND) { + } else if (_error == PARENT_NOT_FOUND) { string msg = "Unable to create patch: Parent "; - msg += m_path.parent() += " not found."; + msg += _path.parent() += " not found."; _responder->respond_error(msg); - } else if (m_error == INVALID_POLY) { + } else if (_error == INVALID_POLY) { string msg = "Unable to create patch "; - msg.append(m_path).append(": ").append("Invalid polyphony respondered."); + msg.append(_path).append(": ").append("Invalid polyphony respondered."); _responder->respond_error(msg); } else { _responder->respond_error("Unable to load patch."); diff --git a/src/libs/engine/events/CreatePatchEvent.h b/src/libs/engine/events/CreatePatchEvent.h index f62b3ee5..069eb52a 100644 --- a/src/libs/engine/events/CreatePatchEvent.h +++ b/src/libs/engine/events/CreatePatchEvent.h @@ -48,13 +48,13 @@ public: private: enum ErrorType { NO_ERROR, OBJECT_EXISTS, PARENT_NOT_FOUND, INVALID_POLY }; - Path m_path; - Patch* m_patch; - Patch* m_parent; - Array<Node*>* m_process_order; - TreeNode<Node*>* m_patch_treenode; - int m_poly; - ErrorType m_error; + Path _path; + Patch* _patch; + Patch* _parent; + Array<Node*>* _process_order; + TreeNode<Node*>* _patch_treenode; + int _poly; + ErrorType _error; }; diff --git a/src/libs/engine/events/DSSIConfigureEvent.cpp b/src/libs/engine/events/DSSIConfigureEvent.cpp index 91225cb0..e19e6d24 100644 --- a/src/libs/engine/events/DSSIConfigureEvent.cpp +++ b/src/libs/engine/events/DSSIConfigureEvent.cpp @@ -26,10 +26,10 @@ namespace Ingen { DSSIConfigureEvent::DSSIConfigureEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, const string& key, const string& val) : QueuedEvent(engine, responder, timestamp), - m_node_path(node_path), - m_key(key), - m_val(val), - m_node(NULL) + _node_path(node_path), + _key(key), + _val(val), + _node(NULL) { } @@ -37,11 +37,11 @@ DSSIConfigureEvent::DSSIConfigureEvent(Engine& engine, SharedPtr<Responder> resp void DSSIConfigureEvent::pre_process() { - Node* node = _engine.object_store()->find_node(m_node_path); + Node* node = _engine.object_store()->find_node(_node_path); if (node != NULL && node->plugin()->type() == Plugin::DSSI) { - m_node = (DSSINode*)node; - m_node->configure(m_key, m_val); + _node = (DSSINode*)node; + _node->configure(_key, _val); } QueuedEvent::pre_process(); @@ -59,12 +59,12 @@ DSSIConfigureEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void DSSIConfigureEvent::post_process() { - if (m_node == NULL) { - cerr << "Unable to find DSSI node " << m_node_path << endl; + if (_node == NULL) { + cerr << "Unable to find DSSI node " << _node_path << endl; } else { string key = "dssi-configure--"; - key += m_key; - _engine.broadcaster()->send_metadata_update(m_node_path, key, Atom(m_val.c_str())); + key += _key; + _engine.broadcaster()->send_metadata_update(_node_path, key, Atom(_val.c_str())); } } diff --git a/src/libs/engine/events/DSSIConfigureEvent.h b/src/libs/engine/events/DSSIConfigureEvent.h index 24472480..0e97702b 100644 --- a/src/libs/engine/events/DSSIConfigureEvent.h +++ b/src/libs/engine/events/DSSIConfigureEvent.h @@ -37,10 +37,10 @@ public: void post_process(); private: - string m_node_path; - string m_key; - string m_val; - DSSINode* m_node; + string _node_path; + string _key; + string _val; + DSSINode* _node; }; diff --git a/src/libs/engine/events/DSSIControlEvent.cpp b/src/libs/engine/events/DSSIControlEvent.cpp index 6c12611c..7867658b 100644 --- a/src/libs/engine/events/DSSIControlEvent.cpp +++ b/src/libs/engine/events/DSSIControlEvent.cpp @@ -25,10 +25,10 @@ namespace Ingen { DSSIControlEvent::DSSIControlEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, int port_num, Sample val) : QueuedEvent(engine, responder, timestamp), - m_node_path(node_path), - m_port_num(port_num), - m_val(val), - m_node(NULL) + _node_path(node_path), + _port_num(port_num), + _val(val), + _node(NULL) { } @@ -36,12 +36,12 @@ DSSIControlEvent::DSSIControlEvent(Engine& engine, SharedPtr<Responder> responde void DSSIControlEvent::pre_process() { - Node* node = _engine.object_store()->find_node(m_node_path); + Node* node = _engine.object_store()->find_node(_node_path); if (node->plugin()->type() != Plugin::DSSI) - m_node = NULL; + _node = NULL; else - m_node = (DSSINode*)node; + _node = (DSSINode*)node; QueuedEvent::pre_process(); } @@ -52,16 +52,16 @@ DSSIControlEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_node != NULL) - m_node->set_control(m_port_num, m_val); + if (_node != NULL) + _node->set_control(_port_num, _val); } void DSSIControlEvent::post_process() { - if (m_node == NULL) - std::cerr << "Unable to find DSSI node " << m_node_path << std::endl; + if (_node == NULL) + std::cerr << "Unable to find DSSI node " << _node_path << std::endl; } diff --git a/src/libs/engine/events/DSSIControlEvent.h b/src/libs/engine/events/DSSIControlEvent.h index 38114c4e..fa76e61f 100644 --- a/src/libs/engine/events/DSSIControlEvent.h +++ b/src/libs/engine/events/DSSIControlEvent.h @@ -39,10 +39,10 @@ public: void post_process(); private: - string m_node_path; - int m_port_num; - float m_val; - DSSINode* m_node; + string _node_path; + int _port_num; + float _val; + DSSINode* _node; }; diff --git a/src/libs/engine/events/DSSIProgramEvent.cpp b/src/libs/engine/events/DSSIProgramEvent.cpp index 5e992cbf..20debca2 100644 --- a/src/libs/engine/events/DSSIProgramEvent.cpp +++ b/src/libs/engine/events/DSSIProgramEvent.cpp @@ -30,10 +30,10 @@ namespace Ingen { DSSIProgramEvent::DSSIProgramEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, int bank, int program) : QueuedEvent(engine, responder, timestamp), - m_node_path(node_path), - m_bank(bank), - m_program(program), - m_node(NULL) + _node_path(node_path), + _bank(bank), + _program(program), + _node(NULL) { } @@ -41,10 +41,10 @@ DSSIProgramEvent::DSSIProgramEvent(Engine& engine, SharedPtr<Responder> responde void DSSIProgramEvent::pre_process() { - Node* node = _engine.object_store()->find_node(m_node_path); + Node* node = _engine.object_store()->find_node(_node_path); if (node != NULL && node->plugin()->type() == Plugin::DSSI) - m_node = (DSSINode*)node; + _node = (DSSINode*)node; QueuedEvent::pre_process(); } @@ -55,21 +55,21 @@ DSSIProgramEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_node != NULL) - m_node->program(m_bank, m_program); + if (_node != NULL) + _node->program(_bank, _program); } void DSSIProgramEvent::post_process() { - if (m_node == NULL) { - cerr << "Unable to find DSSI node " << m_node_path << endl; + if (_node == NULL) { + cerr << "Unable to find DSSI node " << _node_path << endl; } else { // sends program as metadata in the form bank/program char* temp_buf = new char[16]; - snprintf(temp_buf, 16, "%d/%d", m_bank, m_program); - _engine.broadcaster()->send_metadata_update(m_node_path, "dssi-program", temp_buf); + snprintf(temp_buf, 16, "%d/%d", _bank, _program); + _engine.broadcaster()->send_metadata_update(_node_path, "dssi-program", temp_buf); } } diff --git a/src/libs/engine/events/DSSIProgramEvent.h b/src/libs/engine/events/DSSIProgramEvent.h index e01a2cbf..f9babac7 100644 --- a/src/libs/engine/events/DSSIProgramEvent.h +++ b/src/libs/engine/events/DSSIProgramEvent.h @@ -37,10 +37,10 @@ public: void post_process(); private: - string m_node_path; - int m_bank; - int m_program; - DSSINode* m_node; + string _node_path; + int _bank; + int _program; + DSSINode* _node; }; diff --git a/src/libs/engine/events/DSSIUpdateEvent.cpp b/src/libs/engine/events/DSSIUpdateEvent.cpp index 158d7875..4a5a832d 100644 --- a/src/libs/engine/events/DSSIUpdateEvent.cpp +++ b/src/libs/engine/events/DSSIUpdateEvent.cpp @@ -29,9 +29,9 @@ namespace Ingen { DSSIUpdateEvent::DSSIUpdateEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path, const string& url) : QueuedEvent(engine, responder, timestamp), - m_path(path), - m_url(url), - m_node(NULL) + _path(path), + _url(url), + _node(NULL) { } @@ -39,14 +39,14 @@ DSSIUpdateEvent::DSSIUpdateEvent(Engine& engine, SharedPtr<Responder> responder, void DSSIUpdateEvent::pre_process() { - Node* node = _engine.object_store()->find_node(m_path); + Node* node = _engine.object_store()->find_node(_path); if (node == NULL || node->plugin()->type() != Plugin::DSSI) { - m_node = NULL; + _node = NULL; QueuedEvent::pre_process(); return; } else { - m_node = (DSSINode*)node; + _node = (DSSINode*)node; } QueuedEvent::pre_process(); @@ -58,8 +58,8 @@ DSSIUpdateEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_node != NULL) { - m_node->set_ui_url(m_url); + if (_node != NULL) { + _node->set_ui_url(_url); } } @@ -67,10 +67,10 @@ DSSIUpdateEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void DSSIUpdateEvent::post_process() { - cerr << "DSSI update event: " << m_url << endl; + cerr << "DSSI update event: " << _url << endl; - if (m_node != NULL) { - m_node->send_update(); + if (_node != NULL) { + _node->send_update(); } } diff --git a/src/libs/engine/events/DSSIUpdateEvent.h b/src/libs/engine/events/DSSIUpdateEvent.h index 752ec5e8..5097ae89 100644 --- a/src/libs/engine/events/DSSIUpdateEvent.h +++ b/src/libs/engine/events/DSSIUpdateEvent.h @@ -43,9 +43,9 @@ public: void post_process(); private: - string m_path; - string m_url; - DSSINode* m_node; + string _path; + string _url; + DSSINode* _node; }; diff --git a/src/libs/engine/events/DisablePatchEvent.cpp b/src/libs/engine/events/DisablePatchEvent.cpp index ed0234f7..f347b9b3 100644 --- a/src/libs/engine/events/DisablePatchEvent.cpp +++ b/src/libs/engine/events/DisablePatchEvent.cpp @@ -28,8 +28,8 @@ namespace Ingen { DisablePatchEvent::DisablePatchEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& patch_path) : QueuedEvent(engine, responder, timestamp), - m_patch_path(patch_path), - m_patch(NULL) + _patch_path(patch_path), + _patch(NULL) { } @@ -37,7 +37,7 @@ DisablePatchEvent::DisablePatchEvent(Engine& engine, SharedPtr<Responder> respon void DisablePatchEvent::pre_process() { - m_patch = _engine.object_store()->find_patch(m_patch_path); + _patch = _engine.object_store()->find_patch(_patch_path); QueuedEvent::pre_process(); } @@ -48,19 +48,19 @@ DisablePatchEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_patch != NULL) - m_patch->disable(); + if (_patch != NULL) + _patch->disable(); } void DisablePatchEvent::post_process() { - if (m_patch != NULL) { + if (_patch != NULL) { _responder->respond_ok(); - _engine.broadcaster()->send_patch_disable(m_patch_path); + _engine.broadcaster()->send_patch_disable(_patch_path); } else { - _responder->respond_error(string("Patch ") + m_patch_path + " not found"); + _responder->respond_error(string("Patch ") + _patch_path + " not found"); } } diff --git a/src/libs/engine/events/DisablePatchEvent.h b/src/libs/engine/events/DisablePatchEvent.h index 42e04e3b..8b7125c3 100644 --- a/src/libs/engine/events/DisablePatchEvent.h +++ b/src/libs/engine/events/DisablePatchEvent.h @@ -41,8 +41,8 @@ public: void post_process(); private: - string m_patch_path; - Patch* m_patch; + string _patch_path; + Patch* _patch; }; diff --git a/src/libs/engine/events/DisconnectNodeEvent.cpp b/src/libs/engine/events/DisconnectNodeEvent.cpp index e843e272..dcb69401 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.cpp +++ b/src/libs/engine/events/DisconnectNodeEvent.cpp @@ -40,11 +40,11 @@ namespace Ingen { DisconnectNodeEvent::DisconnectNodeEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path) : QueuedEvent(engine, responder, timestamp), - m_node_path(node_path), - m_patch(NULL), - m_node(NULL), - m_succeeded(true), - m_lookup(true) + _node_path(node_path), + _patch(NULL), + _node(NULL), + _succeeded(true), + _lookup(true) { } @@ -53,18 +53,18 @@ DisconnectNodeEvent::DisconnectNodeEvent(Engine& engine, SharedPtr<Responder> re */ DisconnectNodeEvent::DisconnectNodeEvent(Engine& engine, Node* node) : QueuedEvent(engine), - m_node_path(node->path()), - m_patch(node->parent_patch()), - m_node(node), - m_succeeded(true), - m_lookup(false) + _node_path(node->path()), + _patch(node->parent_patch()), + _node(node), + _succeeded(true), + _lookup(false) { } DisconnectNodeEvent::~DisconnectNodeEvent() { - for (List<DisconnectionEvent*>::iterator i = m_disconnection_events.begin(); i != m_disconnection_events.end(); ++i) + for (List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) delete (*i); } @@ -76,37 +76,37 @@ DisconnectNodeEvent::pre_process() // cerr << "Preparing disconnection event...\n"; - if (m_lookup) { - m_patch = _engine.object_store()->find_patch(m_node_path.parent()); + if (_lookup) { + _patch = _engine.object_store()->find_patch(_node_path.parent()); - if (m_patch == NULL) { - m_succeeded = false; + if (_patch == NULL) { + _succeeded = false; QueuedEvent::pre_process(); return; } - m_node = _engine.object_store()->find_node(m_node_path); + _node = _engine.object_store()->find_node(_node_path); - if (m_node == NULL) { - m_succeeded = false; + if (_node == NULL) { + _succeeded = false; QueuedEvent::pre_process(); return; } } Connection* c = NULL; - for (ConnectionListIterator i = m_patch->connections().begin(); i != m_patch->connections().end(); ++i) { + for (ConnectionListIterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { c = (*i); - if ((c->src_port()->parent_node() == m_node || c->dst_port()->parent_node() == m_node) && !c->pending_disconnection()) { + if ((c->src_port()->parent_node() == _node || c->dst_port()->parent_node() == _node) && !c->pending_disconnection()) { DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr<Responder>(new Responder()), _time, c->src_port(), c->dst_port()); ev->pre_process(); - m_disconnection_events.push_back(new ListNode<DisconnectionEvent*>(ev)); + _disconnection_events.push_back(new ListNode<DisconnectionEvent*>(ev)); c->pending_disconnection(true); } } - m_succeeded = true; + _succeeded = true; QueuedEvent::pre_process(); } @@ -116,8 +116,8 @@ DisconnectNodeEvent::execute(SampleCount nframes, FrameTime start, FrameTime end { QueuedEvent::execute(nframes, start, end); - if (m_succeeded) { - for (List<DisconnectionEvent*>::iterator i = m_disconnection_events.begin(); i != m_disconnection_events.end(); ++i) + if (_succeeded) { + for (List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) (*i)->execute(nframes, start, end); } } @@ -126,10 +126,10 @@ DisconnectNodeEvent::execute(SampleCount nframes, FrameTime start, FrameTime end void DisconnectNodeEvent::post_process() { - if (m_succeeded) { + if (_succeeded) { if (_responder) _responder->respond_ok(); - for (List<DisconnectionEvent*>::iterator i = m_disconnection_events.begin(); i != m_disconnection_events.end(); ++i) + for (List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) (*i)->post_process(); } else { if (_responder) diff --git a/src/libs/engine/events/DisconnectNodeEvent.h b/src/libs/engine/events/DisconnectNodeEvent.h index 2c706b65..60c8238f 100644 --- a/src/libs/engine/events/DisconnectNodeEvent.h +++ b/src/libs/engine/events/DisconnectNodeEvent.h @@ -51,14 +51,14 @@ public: void post_process(); private: - Path m_node_path; - Patch* m_patch; - Node* m_node; - List<DisconnectionEvent*> m_disconnection_events; + Path _node_path; + Patch* _patch; + Node* _node; + List<DisconnectionEvent*> _disconnection_events; - bool m_succeeded; - bool m_lookup; - bool m_disconnect_parent; + bool _succeeded; + bool _lookup; + bool _disconnect_parent; }; diff --git a/src/libs/engine/events/DisconnectPortEvent.cpp b/src/libs/engine/events/DisconnectPortEvent.cpp index cfd523e0..cdd49b8b 100644 --- a/src/libs/engine/events/DisconnectPortEvent.cpp +++ b/src/libs/engine/events/DisconnectPortEvent.cpp @@ -40,24 +40,24 @@ namespace Ingen { DisconnectPortEvent::DisconnectPortEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& port_path) : QueuedEvent(engine, responder, timestamp), - m_port_path(port_path), - m_patch(NULL), - m_port(NULL), - m_process_order(NULL), - m_succeeded(true), - m_lookup(true) + _port_path(port_path), + _patch(NULL), + _port(NULL), + _process_order(NULL), + _succeeded(true), + _lookup(true) { } DisconnectPortEvent::DisconnectPortEvent(Engine& engine, Port* port) : QueuedEvent(engine), - m_port_path(port->path()), - m_patch((port->parent_node() == NULL) ? NULL : port->parent_node()->parent_patch()), - m_port(port), - m_process_order(NULL), - m_succeeded(true), - m_lookup(false) + _port_path(port->path()), + _patch((port->parent_node() == NULL) ? NULL : port->parent_node()->parent_patch()), + _port(port), + _process_order(NULL), + _succeeded(true), + _lookup(false) { //cerr << "DisconnectPortEvent(Engine& engine, )\n"; } @@ -65,7 +65,7 @@ DisconnectPortEvent::DisconnectPortEvent(Engine& engine, Port* port) DisconnectPortEvent::~DisconnectPortEvent() { - for (List<DisconnectionEvent*>::iterator i = m_disconnection_events.begin(); i != m_disconnection_events.end(); ++i) + for (List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) delete (*i); } @@ -75,43 +75,43 @@ DisconnectPortEvent::pre_process() { // cerr << "Preparing disconnection event...\n"; - if (m_lookup) { - m_patch = _engine.object_store()->find_patch(m_port_path.parent().parent()); + if (_lookup) { + _patch = _engine.object_store()->find_patch(_port_path.parent().parent()); - if (m_patch == NULL) { - m_succeeded = false; + if (_patch == NULL) { + _succeeded = false; QueuedEvent::pre_process(); return; } - m_port = _engine.object_store()->find_port(m_port_path); + _port = _engine.object_store()->find_port(_port_path); - if (m_port == NULL) { - m_succeeded = false; + if (_port == NULL) { + _succeeded = false; QueuedEvent::pre_process(); return; } } - if (m_patch == NULL) { - m_succeeded = false; + if (_patch == NULL) { + _succeeded = false; QueuedEvent::pre_process(); return; } Connection* c = NULL; - for (List<Connection*>::const_iterator i = m_patch->connections().begin(); i != m_patch->connections().end(); ++i) { + for (List<Connection*>::const_iterator i = _patch->connections().begin(); i != _patch->connections().end(); ++i) { c = (*i); - if ((c->src_port() == m_port || c->dst_port() == m_port) && !c->pending_disconnection()) { + if ((c->src_port() == _port || c->dst_port() == _port) && !c->pending_disconnection()) { DisconnectionEvent* ev = new DisconnectionEvent(_engine, SharedPtr<Responder>(new Responder()), _time, c->src_port(), c->dst_port()); ev->pre_process(); - m_disconnection_events.push_back(new ListNode<DisconnectionEvent*>(ev)); + _disconnection_events.push_back(new ListNode<DisconnectionEvent*>(ev)); c->pending_disconnection(true); } } - m_succeeded = true; + _succeeded = true; QueuedEvent::pre_process(); } @@ -121,8 +121,8 @@ DisconnectPortEvent::execute(SampleCount nframes, FrameTime start, FrameTime end { QueuedEvent::execute(nframes, start, end); - if (m_succeeded) { - for (List<DisconnectionEvent*>::iterator i = m_disconnection_events.begin(); i != m_disconnection_events.end(); ++i) + if (_succeeded) { + for (List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) (*i)->execute(nframes, start, end); } } @@ -131,10 +131,10 @@ DisconnectPortEvent::execute(SampleCount nframes, FrameTime start, FrameTime end void DisconnectPortEvent::post_process() { - if (m_succeeded) { + if (_succeeded) { if (_responder) _responder->respond_ok(); - for (List<DisconnectionEvent*>::iterator i = m_disconnection_events.begin(); i != m_disconnection_events.end(); ++i) + for (List<DisconnectionEvent*>::iterator i = _disconnection_events.begin(); i != _disconnection_events.end(); ++i) (*i)->post_process(); } else { if (_responder) diff --git a/src/libs/engine/events/DisconnectPortEvent.h b/src/libs/engine/events/DisconnectPortEvent.h index 42c0d4e9..57a150ed 100644 --- a/src/libs/engine/events/DisconnectPortEvent.h +++ b/src/libs/engine/events/DisconnectPortEvent.h @@ -52,15 +52,15 @@ public: void post_process(); private: - Path m_port_path; - Patch* m_patch; - Port* m_port; - List<DisconnectionEvent*> m_disconnection_events; + Path _port_path; + Patch* _patch; + Port* _port; + List<DisconnectionEvent*> _disconnection_events; - Array<Node*>* m_process_order; // Patch's new process order + Array<Node*>* _process_order; // Patch's new process order - bool m_succeeded; - bool m_lookup; + bool _succeeded; + bool _lookup; }; diff --git a/src/libs/engine/events/DisconnectionEvent.cpp b/src/libs/engine/events/DisconnectionEvent.cpp index 8dc9e617..58a9727d 100644 --- a/src/libs/engine/events/DisconnectionEvent.cpp +++ b/src/libs/engine/events/DisconnectionEvent.cpp @@ -37,28 +37,28 @@ namespace Ingen { DisconnectionEvent::DisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& src_port_path, const string& dst_port_path) : QueuedEvent(engine, responder, timestamp), - m_src_port_path(src_port_path), - m_dst_port_path(dst_port_path), - m_patch(NULL), - m_src_port(NULL), - m_dst_port(NULL), - m_lookup(true), - m_typed_event(NULL), - m_error(NO_ERROR) + _src_port_path(src_port_path), + _dst_port_path(dst_port_path), + _patch(NULL), + _src_port(NULL), + _dst_port(NULL), + _lookup(true), + _typed_event(NULL), + _error(NO_ERROR) { } DisconnectionEvent::DisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, Port* const src_port, Port* const dst_port) : QueuedEvent(engine, responder, timestamp), - m_src_port_path(src_port->path()), - m_dst_port_path(dst_port->path()), - m_patch(src_port->parent_node()->parent_patch()), - m_src_port(src_port), - m_dst_port(dst_port), - m_lookup(false), - m_typed_event(NULL), - m_error(NO_ERROR) + _src_port_path(src_port->path()), + _dst_port_path(dst_port->path()), + _patch(src_port->parent_node()->parent_patch()), + _src_port(src_port), + _dst_port(dst_port), + _lookup(false), + _typed_event(NULL), + _error(NO_ERROR) { // FIXME: These break for patch ports.. is that ok? /*assert(src_port->is_output()); @@ -70,63 +70,63 @@ DisconnectionEvent::DisconnectionEvent(Engine& engine, SharedPtr<Responder> resp DisconnectionEvent::~DisconnectionEvent() { - delete m_typed_event; + delete _typed_event; } void DisconnectionEvent::pre_process() { - if (m_lookup) { - if (m_src_port_path.parent().parent() != m_dst_port_path.parent().parent() - && m_src_port_path.parent() != m_dst_port_path.parent().parent() - && m_src_port_path.parent().parent() != m_dst_port_path.parent()) { - m_error = PARENT_PATCH_DIFFERENT; + if (_lookup) { + if (_src_port_path.parent().parent() != _dst_port_path.parent().parent() + && _src_port_path.parent() != _dst_port_path.parent().parent() + && _src_port_path.parent().parent() != _dst_port_path.parent()) { + _error = PARENT_PATCH_DIFFERENT; QueuedEvent::pre_process(); return; } - /*m_patch = _engine.object_store()->find_patch(m_src_port_path.parent().parent()); + /*_patch = _engine.object_store()->find_patch(_src_port_path.parent().parent()); - if (m_patch == NULL) { - m_error = PORT_NOT_FOUND; + if (_patch == NULL) { + _error = PORT_NOT_FOUND; QueuedEvent::pre_process(); return; }*/ - m_src_port = _engine.object_store()->find_port(m_src_port_path); - m_dst_port = _engine.object_store()->find_port(m_dst_port_path); + _src_port = _engine.object_store()->find_port(_src_port_path); + _dst_port = _engine.object_store()->find_port(_dst_port_path); } - if (m_src_port == NULL || m_dst_port == NULL) { - m_error = PORT_NOT_FOUND; + if (_src_port == NULL || _dst_port == NULL) { + _error = PORT_NOT_FOUND; QueuedEvent::pre_process(); return; } - if (m_src_port->type() != m_dst_port->type() || m_src_port->buffer_size() != m_dst_port->buffer_size()) { - m_error = TYPE_MISMATCH; + if (_src_port->type() != _dst_port->type() || _src_port->buffer_size() != _dst_port->buffer_size()) { + _error = TYPE_MISMATCH; QueuedEvent::pre_process(); return; } // Create the typed event to actually do the work - const DataType type = m_src_port->type(); + const DataType type = _src_port->type(); if (type == DataType::FLOAT) { - m_typed_event = new TypedDisconnectionEvent<Sample>(_engine, _responder, _time, - dynamic_cast<OutputPort<Sample>*>(m_src_port), dynamic_cast<InputPort<Sample>*>(m_dst_port)); + _typed_event = new TypedDisconnectionEvent<Sample>(_engine, _responder, _time, + dynamic_cast<OutputPort<Sample>*>(_src_port), dynamic_cast<InputPort<Sample>*>(_dst_port)); } else if (type == DataType::MIDI) { - m_typed_event = new TypedDisconnectionEvent<MidiMessage>(_engine, _responder, _time, - dynamic_cast<OutputPort<MidiMessage>*>(m_src_port), dynamic_cast<InputPort<MidiMessage>*>(m_dst_port)); + _typed_event = new TypedDisconnectionEvent<MidiMessage>(_engine, _responder, _time, + dynamic_cast<OutputPort<MidiMessage>*>(_src_port), dynamic_cast<InputPort<MidiMessage>*>(_dst_port)); } else { - m_error = TYPE_MISMATCH; + _error = TYPE_MISMATCH; QueuedEvent::pre_process(); return; } - assert(m_typed_event); - m_typed_event->pre_process(); - assert(m_typed_event->is_prepared()); + assert(_typed_event); + _typed_event->pre_process(); + assert(_typed_event->is_prepared()); QueuedEvent::pre_process(); } @@ -137,20 +137,20 @@ DisconnectionEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_error == NO_ERROR) - m_typed_event->execute(nframes, start, end); + if (_error == NO_ERROR) + _typed_event->execute(nframes, start, end); } void DisconnectionEvent::post_process() { - if (m_error == NO_ERROR) { - m_typed_event->post_process(); + if (_error == NO_ERROR) { + _typed_event->post_process(); } else { // FIXME: better error messages string msg = "Unable to disconnect "; - msg.append(m_src_port_path + " -> " + m_dst_port_path); + msg.append(_src_port_path + " -> " + _dst_port_path); _responder->respond_error(msg); } } @@ -163,11 +163,11 @@ DisconnectionEvent::post_process() template <typename T> TypedDisconnectionEvent<T>::TypedDisconnectionEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, OutputPort<T>* src_port, InputPort<T>* dst_port) : QueuedEvent(engine, responder, timestamp), - m_src_port(src_port), - m_dst_port(dst_port), - m_patch(NULL), - m_process_order(NULL), - m_succeeded(true) + _src_port(src_port), + _dst_port(dst_port), + _patch(NULL), + _process_order(NULL), + _succeeded(true) { assert(src_port != NULL); assert(dst_port != NULL); @@ -178,37 +178,37 @@ template <typename T> void TypedDisconnectionEvent<T>::pre_process() { - if (!m_dst_port->is_connected_to(m_src_port)) { - m_succeeded = false; + if (!_dst_port->is_connected_to(_src_port)) { + _succeeded = false; QueuedEvent::pre_process(); return; } - Node* const src_node = m_src_port->parent_node(); - Node* const dst_node = m_dst_port->parent_node(); + Node* const src_node = _src_port->parent_node(); + Node* const dst_node = _dst_port->parent_node(); // Connection to a patch port from inside the patch if (src_node->parent_patch() != dst_node->parent_patch()) { assert(src_node->parent() == dst_node || dst_node->parent() == src_node); if (src_node->parent() == dst_node) - m_patch = dynamic_cast<Patch*>(dst_node); + _patch = dynamic_cast<Patch*>(dst_node); else - m_patch = dynamic_cast<Patch*>(src_node); + _patch = dynamic_cast<Patch*>(src_node); // Connection from a patch input to a patch output (pass through) } else if (src_node == dst_node && dynamic_cast<Patch*>(src_node)) { - m_patch = dynamic_cast<Patch*>(src_node); + _patch = dynamic_cast<Patch*>(src_node); // Normal connection between nodes with the same parent } else { - m_patch = src_node->parent_patch(); + _patch = src_node->parent_patch(); } - assert(m_patch); + assert(_patch); if (src_node == NULL || dst_node == NULL) { - m_succeeded = false; + _succeeded = false; QueuedEvent::pre_process(); return; } @@ -225,10 +225,10 @@ TypedDisconnectionEvent<T>::pre_process() break; } - if (m_patch->enabled()) - m_process_order = m_patch->build_process_order(); + if (_patch->enabled()) + _process_order = _patch->build_process_order(); - m_succeeded = true; + _succeeded = true; QueuedEvent::pre_process(); } @@ -239,14 +239,14 @@ TypedDisconnectionEvent<T>::execute(SampleCount nframes, FrameTime start, FrameT { QueuedEvent::execute(nframes, start, end); - if (m_succeeded) { + if (_succeeded) { ListNode<TypedConnection<T>*>* const port_connection - = m_dst_port->remove_connection(m_src_port); + = _dst_port->remove_connection(_src_port); if (port_connection != NULL) { ListNode<Connection*>* const patch_connection - = m_patch->remove_connection(m_src_port, m_dst_port); + = _patch->remove_connection(_src_port, _dst_port); assert(patch_connection); assert((Connection*)port_connection->elem() == patch_connection->elem()); @@ -256,11 +256,11 @@ TypedDisconnectionEvent<T>::execute(SampleCount nframes, FrameTime start, FrameT _engine.maid()->push(patch_connection); _engine.maid()->push(port_connection->elem()); - if (m_patch->process_order() != NULL) - _engine.maid()->push(m_patch->process_order()); - m_patch->process_order(m_process_order); + if (_patch->process_order() != NULL) + _engine.maid()->push(_patch->process_order()); + _patch->process_order(_process_order); } else { - m_succeeded = false; // Ports weren't connected + _succeeded = false; // Ports weren't connected } } } @@ -270,11 +270,11 @@ template <typename T> void TypedDisconnectionEvent<T>::post_process() { - if (m_succeeded) { + if (_succeeded) { _responder->respond_ok(); - _engine.broadcaster()->send_disconnection(m_src_port->path(), m_dst_port->path()); + _engine.broadcaster()->send_disconnection(_src_port->path(), _dst_port->path()); } else { _responder->respond_error("Unable to disconnect ports."); } diff --git a/src/libs/engine/events/DisconnectionEvent.h b/src/libs/engine/events/DisconnectionEvent.h index 499799ae..606e7039 100644 --- a/src/libs/engine/events/DisconnectionEvent.h +++ b/src/libs/engine/events/DisconnectionEvent.h @@ -58,17 +58,17 @@ private: enum ErrorType { NO_ERROR, PARENT_PATCH_DIFFERENT, PORT_NOT_FOUND, TYPE_MISMATCH }; - Path m_src_port_path; - Path m_dst_port_path; + Path _src_port_path; + Path _dst_port_path; - Patch* m_patch; - Port* m_src_port; - Port* m_dst_port; + Patch* _patch; + Port* _src_port; + Port* _dst_port; - bool m_lookup; - QueuedEvent* m_typed_event; + bool _lookup; + QueuedEvent* _typed_event; - ErrorType m_error; + ErrorType _error; }; @@ -89,13 +89,13 @@ public: void post_process(); private: - OutputPort<T>* m_src_port; - InputPort<T>* m_dst_port; + OutputPort<T>* _src_port; + InputPort<T>* _dst_port; - Patch* m_patch; - Array<Node*>* m_process_order; ///< New process order for Patch + Patch* _patch; + Array<Node*>* _process_order; ///< New process order for Patch - bool m_succeeded; + bool _succeeded; }; diff --git a/src/libs/engine/events/EnablePatchEvent.cpp b/src/libs/engine/events/EnablePatchEvent.cpp index b4abddf0..599fbbf7 100644 --- a/src/libs/engine/events/EnablePatchEvent.cpp +++ b/src/libs/engine/events/EnablePatchEvent.cpp @@ -27,9 +27,9 @@ namespace Ingen { EnablePatchEvent::EnablePatchEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& patch_path) : QueuedEvent(engine, responder, timestamp), - m_patch_path(patch_path), - m_patch(NULL), - m_process_order(NULL) + _patch_path(patch_path), + _patch(NULL), + _process_order(NULL) { } @@ -37,14 +37,14 @@ EnablePatchEvent::EnablePatchEvent(Engine& engine, SharedPtr<Responder> responde void EnablePatchEvent::pre_process() { - m_patch = _engine.object_store()->find_patch(m_patch_path); + _patch = _engine.object_store()->find_patch(_patch_path); - if (m_patch != NULL) { + if (_patch != NULL) { /* Any event that requires a new process order will set the patch's * process order to NULL if it is executed when the patch is not * active. So, if the PO is NULL, calculate it here */ - if (m_patch->process_order() == NULL) - m_process_order = m_patch->build_process_order(); + if (_patch->process_order() == NULL) + _process_order = _patch->build_process_order(); } QueuedEvent::pre_process(); @@ -56,11 +56,11 @@ EnablePatchEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) { QueuedEvent::execute(nframes, start, end); - if (m_patch != NULL) { - m_patch->enable(); + if (_patch != NULL) { + _patch->enable(); - if (m_patch->process_order() == NULL) - m_patch->process_order(m_process_order); + if (_patch->process_order() == NULL) + _patch->process_order(_process_order); } } @@ -68,11 +68,11 @@ EnablePatchEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void EnablePatchEvent::post_process() { - if (m_patch != NULL) { + if (_patch != NULL) { _responder->respond_ok(); - _engine.broadcaster()->send_patch_enable(m_patch_path); + _engine.broadcaster()->send_patch_enable(_patch_path); } else { - _responder->respond_error(string("Patch ") + m_patch_path + " not found"); + _responder->respond_error(string("Patch ") + _patch_path + " not found"); } } diff --git a/src/libs/engine/events/EnablePatchEvent.h b/src/libs/engine/events/EnablePatchEvent.h index 53d2b779..2c34e3d5 100644 --- a/src/libs/engine/events/EnablePatchEvent.h +++ b/src/libs/engine/events/EnablePatchEvent.h @@ -44,9 +44,9 @@ public: void post_process(); private: - string m_patch_path; - Patch* m_patch; - Array<Node*>* m_process_order; // Patch's new process order + string _patch_path; + Patch* _patch; + Array<Node*>* _process_order; // Patch's new process order }; diff --git a/src/libs/engine/events/MidiLearnEvent.cpp b/src/libs/engine/events/MidiLearnEvent.cpp index b36a5363..7d1a25e0 100644 --- a/src/libs/engine/events/MidiLearnEvent.cpp +++ b/src/libs/engine/events/MidiLearnEvent.cpp @@ -30,7 +30,7 @@ namespace Ingen { void MidiLearnResponseEvent::post_process() { - _engine.broadcaster()->send_control_change(m_port_path, m_value); + _engine.broadcaster()->send_control_change(_port_path, _value); } @@ -39,9 +39,9 @@ MidiLearnResponseEvent::post_process() MidiLearnEvent::MidiLearnEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path) : QueuedEvent(engine, responder, timestamp), - m_node_path(node_path), - m_node(NULL), - m_response_event(NULL) + _node_path(node_path), + _node(NULL), + _response_event(NULL) { } @@ -49,8 +49,8 @@ MidiLearnEvent::MidiLearnEvent(Engine& engine, SharedPtr<Responder> responder, S void MidiLearnEvent::pre_process() { - m_node = _engine.object_store()->find_node(m_node_path); - m_response_event = new MidiLearnResponseEvent(_engine, m_node_path + "/Controller_Number", _time); + _node = _engine.object_store()->find_node(_node_path); + _response_event = new MidiLearnResponseEvent(_engine, _node_path + "/Controller_Number", _time); QueuedEvent::pre_process(); } @@ -62,9 +62,9 @@ MidiLearnEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) QueuedEvent::execute(nframes, start, end); // FIXME: this isn't very good at all. - if (m_node != NULL && m_node->plugin()->type() == Plugin::Internal - && m_node->plugin()->plug_label() == "midi_control_in") { - ((MidiControlNode*)m_node)->learn(m_response_event); + if (_node != NULL && _node->plugin()->type() == Plugin::Internal + && _node->plugin()->plug_label() == "midi_control_in") { + ((MidiControlNode*)_node)->learn(_response_event); } } @@ -72,11 +72,11 @@ MidiLearnEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void MidiLearnEvent::post_process() { - if (m_node != NULL) { + if (_node != NULL) { _responder->respond_ok(); } else { string msg = "Did not find node '"; - msg.append(m_node_path).append("' for MIDI learn."); + msg.append(_node_path).append("' for MIDI learn."); _responder->respond_error(msg); } } diff --git a/src/libs/engine/events/MidiLearnEvent.h b/src/libs/engine/events/MidiLearnEvent.h index a6eb7d2d..281f3c03 100644 --- a/src/libs/engine/events/MidiLearnEvent.h +++ b/src/libs/engine/events/MidiLearnEvent.h @@ -39,16 +39,16 @@ class MidiLearnResponseEvent : public Event public: MidiLearnResponseEvent(Engine& engine, const string& port_path, SampleCount timestamp) : Event(engine, SharedPtr<Responder>(), timestamp), - m_port_path(port_path), - m_value(0.0f) + _port_path(port_path), + _value(0.0f) {} - void set_value(Sample val) { m_value = val; } + void set_value(Sample val) { _value = val; } void post_process(); private: - string m_port_path; - Sample m_value; + string _port_path; + Sample _value; }; @@ -71,11 +71,11 @@ public: void post_process(); private: - string m_node_path; - Node* m_node; + string _node_path; + Node* _node; /// Event to respond with when learned - MidiLearnResponseEvent* m_response_event; + MidiLearnResponseEvent* _response_event; }; diff --git a/src/libs/engine/events/NoteOffEvent.cpp b/src/libs/engine/events/NoteOffEvent.cpp index adc7ac56..f8dfe8eb 100644 --- a/src/libs/engine/events/NoteOffEvent.cpp +++ b/src/libs/engine/events/NoteOffEvent.cpp @@ -29,8 +29,8 @@ namespace Ingen { */ NoteOffEvent::NoteOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, Node* node, uchar note_num) : Event(engine, responder, timestamp), - m_node(node), - m_note_num(note_num) + _node(node), + _note_num(note_num) { } @@ -39,9 +39,9 @@ NoteOffEvent::NoteOffEvent(Engine& engine, SharedPtr<Responder> responder, Sampl */ NoteOffEvent::NoteOffEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, uchar note_num) : Event(engine, responder, timestamp), - m_node(NULL), - m_node_path(node_path), - m_note_num(note_num) + _node(NULL), + _node_path(node_path), + _note_num(note_num) { } @@ -52,15 +52,15 @@ NoteOffEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) Event::execute(nframes, start, end); assert(_time >= start && _time <= end); - if (m_node == NULL && m_node_path != "") - m_node = _engine.object_store()->find_node(m_node_path); + if (_node == NULL && _node_path != "") + _node = _engine.object_store()->find_node(_node_path); // FIXME: this isn't very good at all. - if (m_node != NULL && m_node->plugin()->type() == Plugin::Internal) { - if (m_node->plugin()->plug_label() == "note_in") - ((MidiNoteNode*)m_node)->note_off(m_note_num, _time, nframes, start, end); - else if (m_node->plugin()->plug_label() == "trigger_in") - ((MidiTriggerNode*)m_node)->note_off(m_note_num, _time, nframes, start, end); + if (_node != NULL && _node->plugin()->type() == Plugin::Internal) { + if (_node->plugin()->plug_label() == "note_in") + ((MidiNoteNode*)_node)->note_off(_note_num, _time, nframes, start, end); + else if (_node->plugin()->plug_label() == "trigger_in") + ((MidiTriggerNode*)_node)->note_off(_note_num, _time, nframes, start, end); } } @@ -68,7 +68,7 @@ NoteOffEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void NoteOffEvent::post_process() { - if (m_node != NULL) + if (_node != NULL) _responder->respond_ok(); else _responder->respond_error("Did not find node for note_off"); diff --git a/src/libs/engine/events/NoteOffEvent.h b/src/libs/engine/events/NoteOffEvent.h index 35706f26..6b5ee185 100644 --- a/src/libs/engine/events/NoteOffEvent.h +++ b/src/libs/engine/events/NoteOffEvent.h @@ -41,9 +41,9 @@ public: void post_process(); private: - Node* m_node; - string m_node_path; - uchar m_note_num; + Node* _node; + string _node_path; + uchar _note_num; }; diff --git a/src/libs/engine/events/NoteOnEvent.cpp b/src/libs/engine/events/NoteOnEvent.cpp index f94ebb97..f39a71b6 100644 --- a/src/libs/engine/events/NoteOnEvent.cpp +++ b/src/libs/engine/events/NoteOnEvent.cpp @@ -32,10 +32,10 @@ namespace Ingen { */ NoteOnEvent::NoteOnEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, Node* patch, uchar note_num, uchar velocity) : Event(engine, responder, timestamp), - m_node(patch), - m_note_num(note_num), - m_velocity(velocity), - m_is_osc_triggered(false) + _node(patch), + _note_num(note_num), + _velocity(velocity), + _is_osc_triggered(false) { } @@ -46,11 +46,11 @@ NoteOnEvent::NoteOnEvent(Engine& engine, SharedPtr<Responder> responder, SampleC */ NoteOnEvent::NoteOnEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, uchar note_num, uchar velocity) : Event(engine, responder, timestamp), - m_node(NULL), - m_node_path(node_path), - m_note_num(note_num), - m_velocity(velocity), - m_is_osc_triggered(true) + _node(NULL), + _node_path(node_path), + _note_num(note_num), + _velocity(velocity), + _is_osc_triggered(true) { } @@ -62,15 +62,15 @@ NoteOnEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) assert(_time >= start && _time <= end); // Lookup if neccessary - if (m_is_osc_triggered) - m_node = _engine.object_store()->find_node(m_node_path); + if (_is_osc_triggered) + _node = _engine.object_store()->find_node(_node_path); // FIXME: this isn't very good at all. - if (m_node != NULL && m_node->plugin()->type() == Plugin::Internal) { - if (m_node->plugin()->plug_label() == "note_in") - ((MidiNoteNode*)m_node)->note_on(m_note_num, m_velocity, _time, nframes, start, end); - else if (m_node->plugin()->plug_label() == "trigger_in") - ((MidiTriggerNode*)m_node)->note_on(m_note_num, m_velocity, _time, nframes, start, end); + if (_node != NULL && _node->plugin()->type() == Plugin::Internal) { + if (_node->plugin()->plug_label() == "note_in") + ((MidiNoteNode*)_node)->note_on(_note_num, _velocity, _time, nframes, start, end); + else if (_node->plugin()->plug_label() == "trigger_in") + ((MidiTriggerNode*)_node)->note_on(_note_num, _velocity, _time, nframes, start, end); } } @@ -78,8 +78,8 @@ NoteOnEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void NoteOnEvent::post_process() { - if (m_is_osc_triggered) { - if (m_node != NULL) + if (_is_osc_triggered) { + if (_node != NULL) _responder->respond_ok(); else _responder->respond_error("Did not find node for note_on"); diff --git a/src/libs/engine/events/NoteOnEvent.h b/src/libs/engine/events/NoteOnEvent.h index f7bceb4a..0b592548 100644 --- a/src/libs/engine/events/NoteOnEvent.h +++ b/src/libs/engine/events/NoteOnEvent.h @@ -41,11 +41,11 @@ public: void post_process(); private: - Node* m_node; - string m_node_path; - uchar m_note_num; - uchar m_velocity; - bool m_is_osc_triggered; + Node* _node; + string _node_path; + uchar _note_num; + uchar _velocity; + bool _is_osc_triggered; }; diff --git a/src/libs/engine/events/RenameEvent.cpp b/src/libs/engine/events/RenameEvent.cpp index f7b9bcf8..3ce22e07 100644 --- a/src/libs/engine/events/RenameEvent.cpp +++ b/src/libs/engine/events/RenameEvent.cpp @@ -29,18 +29,18 @@ namespace Ingen { RenameEvent::RenameEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path, const string& name) : QueuedEvent(engine, responder, timestamp), - m_old_path(path), - m_name(name), - m_new_path(m_old_path.parent().base() + name), - m_parent_patch(NULL), - m_store_treenode(NULL), - m_error(NO_ERROR) + _old_path(path), + _name(name), + _new_path(_old_path.parent().base() + name), + _parent_patch(NULL), + _store_treenode(NULL), + _error(NO_ERROR) { /* - if (m_old_path.parent() == "/") - m_new_path = string("/") + m_name; + if (_old_path.parent() == "/") + _new_path = string("/") + _name; else - m_new_path = m_old_path.parent() +"/"+ m_name;*/ + _new_path = _old_path.parent() +"/"+ _name;*/ } @@ -52,36 +52,36 @@ RenameEvent::~RenameEvent() void RenameEvent::pre_process() { - if (m_name.find("/") != string::npos) { - m_error = INVALID_NAME; + if (_name.find("/") != string::npos) { + _error = INVALID_NAME; QueuedEvent::pre_process(); return; } - if (_engine.object_store()->find(m_new_path)) { - m_error = OBJECT_EXISTS; + if (_engine.object_store()->find(_new_path)) { + _error = OBJECT_EXISTS; QueuedEvent::pre_process(); return; } - GraphObject* obj = _engine.object_store()->find(m_old_path); + GraphObject* obj = _engine.object_store()->find(_old_path); if (obj == NULL) { - m_error = OBJECT_NOT_FOUND; + _error = OBJECT_NOT_FOUND; QueuedEvent::pre_process(); return; } // Renaming only works for Nodes and Patches (which are Nodes) /*if (obj->as_node() == NULL) { - m_error = OBJECT_NOT_RENAMABLE; + _error = OBJECT_NOT_RENAMABLE; QueuedEvent::pre_process(); return; }*/ if (obj != NULL) { - obj->set_path(m_new_path); - assert(obj->path() == m_new_path); + obj->set_path(_new_path); + assert(obj->path() == _new_path); } QueuedEvent::pre_process(); @@ -101,18 +101,18 @@ RenameEvent::post_process() { string msg = "Unable to rename object - "; - if (m_error == NO_ERROR) { + if (_error == NO_ERROR) { _responder->respond_ok(); - _engine.broadcaster()->send_rename(m_old_path, m_new_path); + _engine.broadcaster()->send_rename(_old_path, _new_path); } else { - if (m_error == OBJECT_EXISTS) - msg.append("Object already exists at ").append(m_new_path); - else if (m_error == OBJECT_NOT_FOUND) - msg.append("Could not find object ").append(m_old_path); - else if (m_error == OBJECT_NOT_RENAMABLE) - msg.append(m_old_path).append(" is not renamable"); - else if (m_error == INVALID_NAME) - msg.append(m_name).append(" is not a valid name"); + if (_error == OBJECT_EXISTS) + msg.append("Object already exists at ").append(_new_path); + else if (_error == OBJECT_NOT_FOUND) + msg.append("Could not find object ").append(_old_path); + else if (_error == OBJECT_NOT_RENAMABLE) + msg.append(_old_path).append(" is not renamable"); + else if (_error == INVALID_NAME) + msg.append(_name).append(" is not a valid name"); _responder->respond_error(msg); } diff --git a/src/libs/engine/events/RenameEvent.h b/src/libs/engine/events/RenameEvent.h index cf866fb9..9c04314b 100644 --- a/src/libs/engine/events/RenameEvent.h +++ b/src/libs/engine/events/RenameEvent.h @@ -52,12 +52,12 @@ public: private: enum ErrorType { NO_ERROR, OBJECT_NOT_FOUND, OBJECT_EXISTS, OBJECT_NOT_RENAMABLE, INVALID_NAME }; - Path m_old_path; - string m_name; - Path m_new_path; - Patch* m_parent_patch; - TreeNode<GraphObject*>* m_store_treenode; - ErrorType m_error; + Path _old_path; + string _name; + Path _new_path; + Patch* _parent_patch; + TreeNode<GraphObject*>* _store_treenode; + ErrorType _error; }; diff --git a/src/libs/engine/events/RequestAllObjectsEvent.cpp b/src/libs/engine/events/RequestAllObjectsEvent.cpp index 3c164ce2..43974076 100644 --- a/src/libs/engine/events/RequestAllObjectsEvent.cpp +++ b/src/libs/engine/events/RequestAllObjectsEvent.cpp @@ -33,7 +33,7 @@ RequestAllObjectsEvent::RequestAllObjectsEvent(Engine& engine, SharedPtr<Respond void RequestAllObjectsEvent::pre_process() { - m_client = _engine.broadcaster()->client(_responder->client_key()); + _client = _engine.broadcaster()->client(_responder->client_key()); QueuedEvent::pre_process(); } @@ -42,13 +42,13 @@ RequestAllObjectsEvent::pre_process() void RequestAllObjectsEvent::post_process() { - if (m_client) { + if (_client) { _responder->respond_ok(); // Everything is a child of the root patch, so this sends it all Patch* root = _engine.object_store()->find_patch("/"); if (root) - ObjectSender::send_patch(m_client.get(), root, true); + ObjectSender::send_patch(_client.get(), root, true); } else { _responder->respond_error("Unable to find client to send all objects"); diff --git a/src/libs/engine/events/RequestAllObjectsEvent.h b/src/libs/engine/events/RequestAllObjectsEvent.h index 46d22aab..dd89e421 100644 --- a/src/libs/engine/events/RequestAllObjectsEvent.h +++ b/src/libs/engine/events/RequestAllObjectsEvent.h @@ -41,7 +41,7 @@ public: void post_process(); private: - SharedPtr<ClientInterface> m_client; + SharedPtr<ClientInterface> _client; }; diff --git a/src/libs/engine/events/RequestMetadataEvent.cpp b/src/libs/engine/events/RequestMetadataEvent.cpp index 9437ccbf..1c7c4578 100644 --- a/src/libs/engine/events/RequestMetadataEvent.cpp +++ b/src/libs/engine/events/RequestMetadataEvent.cpp @@ -29,10 +29,10 @@ namespace Ingen { RequestMetadataEvent::RequestMetadataEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& node_path, const string& key) : QueuedEvent(engine, responder, timestamp), - m_path(node_path), - m_key(key), - m_object(NULL), - m_client(SharedPtr<ClientInterface>()) + _path(node_path), + _key(key), + _object(NULL), + _client(SharedPtr<ClientInterface>()) { } @@ -40,17 +40,17 @@ RequestMetadataEvent::RequestMetadataEvent(Engine& engine, SharedPtr<Responder> void RequestMetadataEvent::pre_process() { - m_client = _engine.broadcaster()->client(_responder->client_key()); + _client = _engine.broadcaster()->client(_responder->client_key()); - if (m_client) { - m_object = _engine.object_store()->find(m_path); - if (m_object == NULL) { + if (_client) { + _object = _engine.object_store()->find(_path); + if (_object == NULL) { QueuedEvent::pre_process(); return; } } - m_value = m_object->get_metadata(m_key); + _value = _object->get_metadata(_key); QueuedEvent::pre_process(); } @@ -59,14 +59,14 @@ RequestMetadataEvent::pre_process() void RequestMetadataEvent::post_process() { - if (m_client) { - if (!m_object) { + if (_client) { + if (!_object) { string msg = "Unable to find metadata subject "; - msg += m_path; + msg += _path; _responder->respond_error(msg); } else { _responder->respond_ok(); - m_client->metadata_update(m_path, m_key, m_value); + _client->metadata_update(_path, _key, _value); } } else { _responder->respond_error("Unknown client"); diff --git a/src/libs/engine/events/RequestMetadataEvent.h b/src/libs/engine/events/RequestMetadataEvent.h index 6b782ed2..0c95b74e 100644 --- a/src/libs/engine/events/RequestMetadataEvent.h +++ b/src/libs/engine/events/RequestMetadataEvent.h @@ -43,11 +43,11 @@ public: void post_process(); private: - string m_path; - string m_key; - Raul::Atom m_value; - GraphObject* m_object; - SharedPtr<ClientInterface> m_client; + string _path; + string _key; + Raul::Atom _value; + GraphObject* _object; + SharedPtr<ClientInterface> _client; }; diff --git a/src/libs/engine/events/RequestObjectEvent.cpp b/src/libs/engine/events/RequestObjectEvent.cpp index cd63f28e..72526299 100644 --- a/src/libs/engine/events/RequestObjectEvent.cpp +++ b/src/libs/engine/events/RequestObjectEvent.cpp @@ -33,8 +33,8 @@ namespace Ingen { RequestObjectEvent::RequestObjectEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path) : QueuedEvent(engine, responder, timestamp), - m_path(path), - m_object(NULL) + _path(path), + _object(NULL) { } @@ -42,8 +42,8 @@ RequestObjectEvent::RequestObjectEvent(Engine& engine, SharedPtr<Responder> resp void RequestObjectEvent::pre_process() { - m_client = _engine.broadcaster()->client(_responder->client_key()); - m_object = _engine.object_store()->find(m_path); + _client = _engine.broadcaster()->client(_responder->client_key()); + _object = _engine.object_store()->find(_path); QueuedEvent::pre_process(); } @@ -60,28 +60,28 @@ RequestObjectEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void RequestObjectEvent::post_process() { - if (!m_object) { + if (!_object) { _responder->respond_error("Unable to find object requested."); - } else if (m_client) { - Patch* const patch = dynamic_cast<Patch*>(m_object); + } else if (_client) { + Patch* const patch = dynamic_cast<Patch*>(_object); if (patch) { _responder->respond_ok(); - ObjectSender::send_patch(m_client.get(), patch, true); + ObjectSender::send_patch(_client.get(), patch, true); return; } - Node* const node = dynamic_cast<Node*>(m_object); + Node* const node = dynamic_cast<Node*>(_object); if (node) { _responder->respond_ok(); - ObjectSender::send_node(m_client.get(), node, true); + ObjectSender::send_node(_client.get(), node, true); return; } - Port* const port = dynamic_cast<Port*>(m_object); + Port* const port = dynamic_cast<Port*>(_object); if (port) { _responder->respond_ok(); - ObjectSender::send_port(m_client.get(), port); + ObjectSender::send_port(_client.get(), port); return; } diff --git a/src/libs/engine/events/RequestObjectEvent.h b/src/libs/engine/events/RequestObjectEvent.h index b6041d2e..e80a9003 100644 --- a/src/libs/engine/events/RequestObjectEvent.h +++ b/src/libs/engine/events/RequestObjectEvent.h @@ -44,9 +44,9 @@ public: void post_process(); private: - string m_path; - GraphObject* m_object; - SharedPtr<ClientInterface> m_client; + string _path; + GraphObject* _object; + SharedPtr<ClientInterface> _client; }; diff --git a/src/libs/engine/events/RequestPluginEvent.cpp b/src/libs/engine/events/RequestPluginEvent.cpp index 8663f40a..66093ee8 100644 --- a/src/libs/engine/events/RequestPluginEvent.cpp +++ b/src/libs/engine/events/RequestPluginEvent.cpp @@ -32,8 +32,8 @@ namespace Ingen { RequestPluginEvent::RequestPluginEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& uri) : QueuedEvent(engine, responder, timestamp), - m_uri(uri), - m_plugin(NULL) + _uri(uri), + _plugin(NULL) { } @@ -41,8 +41,8 @@ RequestPluginEvent::RequestPluginEvent(Engine& engine, SharedPtr<Responder> resp void RequestPluginEvent::pre_process() { - m_client = _engine.broadcaster()->client(_responder->client_key()); - m_plugin = _engine.node_factory()->plugin(m_uri); + _client = _engine.broadcaster()->client(_responder->client_key()); + _plugin = _engine.node_factory()->plugin(_uri); QueuedEvent::pre_process(); } @@ -59,14 +59,14 @@ RequestPluginEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void RequestPluginEvent::post_process() { - if (!m_plugin) { + if (!_plugin) { _responder->respond_error("Unable to find plugin requested."); - } else if (m_client) { + } else if (_client) { _responder->respond_ok(); - assert(m_plugin->uri() == m_uri); - m_client->new_plugin(m_uri, m_plugin->type_uri(), m_plugin->name()); + assert(_plugin->uri() == _uri); + _client->new_plugin(_uri, _plugin->type_uri(), _plugin->name()); } else { _responder->respond_error("Unable to find client to send plugin."); diff --git a/src/libs/engine/events/RequestPluginEvent.h b/src/libs/engine/events/RequestPluginEvent.h index 8833f842..cae0aafe 100644 --- a/src/libs/engine/events/RequestPluginEvent.h +++ b/src/libs/engine/events/RequestPluginEvent.h @@ -44,9 +44,9 @@ public: void post_process(); private: - string m_uri; - const Plugin* m_plugin; - SharedPtr<ClientInterface> m_client; + string _uri; + const Plugin* _plugin; + SharedPtr<ClientInterface> _client; }; diff --git a/src/libs/engine/events/RequestPluginsEvent.cpp b/src/libs/engine/events/RequestPluginsEvent.cpp index da726e13..24fb055c 100644 --- a/src/libs/engine/events/RequestPluginsEvent.cpp +++ b/src/libs/engine/events/RequestPluginsEvent.cpp @@ -32,11 +32,11 @@ RequestPluginsEvent::RequestPluginsEvent(Engine& engine, SharedPtr<Responder> re void RequestPluginsEvent::pre_process() { - m_client = _engine.broadcaster()->client(_responder->client_key()); + _client = _engine.broadcaster()->client(_responder->client_key()); // Take a copy to send in the post processing thread (to avoid problems // because std::list isn't thread safe) - m_plugins = _engine.node_factory()->plugins(); + _plugins = _engine.node_factory()->plugins(); QueuedEvent::pre_process(); } @@ -45,8 +45,8 @@ RequestPluginsEvent::pre_process() void RequestPluginsEvent::post_process() { - if (m_client) { - _engine.broadcaster()->send_plugins_to(m_client, m_plugins); + if (_client) { + _engine.broadcaster()->send_plugins_to(_client, _plugins); _responder->respond_ok(); } else { _responder->respond_error("Unable to find client to send plugins"); diff --git a/src/libs/engine/events/RequestPluginsEvent.h b/src/libs/engine/events/RequestPluginsEvent.h index 6355c037..d0ba3446 100644 --- a/src/libs/engine/events/RequestPluginsEvent.h +++ b/src/libs/engine/events/RequestPluginsEvent.h @@ -44,8 +44,8 @@ public: void post_process(); private: - SharedPtr<ClientInterface> m_client; - std::list<Plugin*> m_plugins; + SharedPtr<ClientInterface> _client; + std::list<Plugin*> _plugins; }; diff --git a/src/libs/engine/events/RequestPortValueEvent.cpp b/src/libs/engine/events/RequestPortValueEvent.cpp index 8457486f..30daa038 100644 --- a/src/libs/engine/events/RequestPortValueEvent.cpp +++ b/src/libs/engine/events/RequestPortValueEvent.cpp @@ -30,9 +30,9 @@ namespace Ingen { RequestPortValueEvent::RequestPortValueEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& port_path) : QueuedEvent(engine, responder, timestamp), - m_port_path(port_path), - m_port(NULL), - m_value(0.0) + _port_path(port_path), + _port(NULL), + _value(0.0) { } @@ -40,8 +40,8 @@ RequestPortValueEvent::RequestPortValueEvent(Engine& engine, SharedPtr<Responder void RequestPortValueEvent::pre_process() { - m_client = _engine.broadcaster()->client(_responder->client_key()); - m_port = _engine.object_store()->find_port(m_port_path); + _client = _engine.broadcaster()->client(_responder->client_key()); + _port = _engine.object_store()->find_port(_port_path); QueuedEvent::pre_process(); } @@ -53,10 +53,10 @@ RequestPortValueEvent::execute(SampleCount nframes, FrameTime start, FrameTime e QueuedEvent::execute(nframes, start, end); assert(_time >= start && _time <= end); - if (m_port != NULL && m_port->type() == DataType::FLOAT) - m_value = ((TypedPort<Sample>*)m_port)->buffer(0)->value_at(0/*_time - start*/); + if (_port != NULL && _port->type() == DataType::FLOAT) + _value = ((TypedPort<Sample>*)_port)->buffer(0)->value_at(0/*_time - start*/); else - m_port = NULL; // triggers error response + _port = NULL; // triggers error response } @@ -64,11 +64,11 @@ void RequestPortValueEvent::post_process() { string msg; - if (!m_port) { + if (!_port) { _responder->respond_error("Unable to find port for get_value responder."); - } else if (m_client) { + } else if (_client) { _responder->respond_ok(); - m_client->control_change(m_port_path, m_value); + _client->control_change(_port_path, _value); } else { _responder->respond_error("Unable to find client to send port value"); } diff --git a/src/libs/engine/events/RequestPortValueEvent.h b/src/libs/engine/events/RequestPortValueEvent.h index 55831f31..aceaaf85 100644 --- a/src/libs/engine/events/RequestPortValueEvent.h +++ b/src/libs/engine/events/RequestPortValueEvent.h @@ -44,10 +44,10 @@ public: void post_process(); private: - string m_port_path; - Port* m_port; - Sample m_value; - SharedPtr<ClientInterface> m_client; + string _port_path; + Port* _port; + Sample _value; + SharedPtr<ClientInterface> _client; }; diff --git a/src/libs/engine/events/SetMetadataEvent.cpp b/src/libs/engine/events/SetMetadataEvent.cpp index ba3d88e9..cc405a89 100644 --- a/src/libs/engine/events/SetMetadataEvent.cpp +++ b/src/libs/engine/events/SetMetadataEvent.cpp @@ -29,10 +29,10 @@ namespace Ingen { SetMetadataEvent::SetMetadataEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& path, const string& key, const Atom& value) : QueuedEvent(engine, responder, timestamp), - m_path(path), - m_key(key), - m_value(value), - m_object(NULL) + _path(path), + _key(key), + _value(value), + _object(NULL) { } @@ -40,13 +40,13 @@ SetMetadataEvent::SetMetadataEvent(Engine& engine, SharedPtr<Responder> responde void SetMetadataEvent::pre_process() { - m_object = _engine.object_store()->find(m_path); - if (m_object == NULL) { + _object = _engine.object_store()->find(_path); + if (_object == NULL) { QueuedEvent::pre_process(); return; } - m_object->set_metadata(m_key, m_value); + _object->set_metadata(_key, _value); QueuedEvent::pre_process(); } @@ -63,13 +63,13 @@ SetMetadataEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void SetMetadataEvent::post_process() { - if (m_object == NULL) { + if (_object == NULL) { string msg = "Unable to find object "; - msg += m_path; + msg += _path; _responder->respond_error(msg); } else { _responder->respond_ok(); - _engine.broadcaster()->send_metadata_update(m_path, m_key, m_value); + _engine.broadcaster()->send_metadata_update(_path, _key, _value); } } diff --git a/src/libs/engine/events/SetMetadataEvent.h b/src/libs/engine/events/SetMetadataEvent.h index adf73878..0b2a4075 100644 --- a/src/libs/engine/events/SetMetadataEvent.h +++ b/src/libs/engine/events/SetMetadataEvent.h @@ -42,10 +42,10 @@ public: void post_process(); private: - string m_path; - string m_key; - Raul::Atom m_value; - GraphObject* m_object; + string _path; + string _key; + Raul::Atom _value; + GraphObject* _object; }; diff --git a/src/libs/engine/events/SetPortValueEvent.cpp b/src/libs/engine/events/SetPortValueEvent.cpp index bba5bc3c..11eb91da 100644 --- a/src/libs/engine/events/SetPortValueEvent.cpp +++ b/src/libs/engine/events/SetPortValueEvent.cpp @@ -29,22 +29,22 @@ namespace Ingen { */ SetPortValueEvent::SetPortValueEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, size_t voice_num, const string& port_path, Sample val) : Event(engine, responder, timestamp), - m_voice_num(voice_num), - m_port_path(port_path), - m_val(val), - m_port(NULL), - m_error(NO_ERROR) + _voice_num(voice_num), + _port_path(port_path), + _val(val), + _port(NULL), + _error(NO_ERROR) { } SetPortValueEvent::SetPortValueEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& port_path, Sample val) : Event(engine, responder, timestamp), - m_voice_num(-1), - m_port_path(port_path), - m_val(val), - m_port(NULL), - m_error(NO_ERROR) + _voice_num(-1), + _port_path(port_path), + _val(val), + _port(NULL), + _error(NO_ERROR) { } @@ -55,19 +55,19 @@ SetPortValueEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) Event::execute(nframes, start, end); assert(_time >= start && _time <= end); - if (m_port == NULL) - m_port = _engine.object_store()->find_port(m_port_path); + if (_port == NULL) + _port = _engine.object_store()->find_port(_port_path); - if (m_port == NULL) { - m_error = PORT_NOT_FOUND; - } else if (!(m_port->type() == DataType::FLOAT)) { - m_error = TYPE_MISMATCH; + if (_port == NULL) { + _error = PORT_NOT_FOUND; + } else if (!(_port->type() == DataType::FLOAT)) { + _error = TYPE_MISMATCH; } else { - if (m_voice_num == -1) - ((TypedPort<Sample>*)m_port)->set_value(m_val, _time - start); + if (_voice_num == -1) + ((TypedPort<Sample>*)_port)->set_value(_val, _time - start); else - ((TypedPort<Sample>*)m_port)->set_value(m_voice_num, m_val, _time - start); - //((TypedPort<Sample>*)m_port)->buffer(m_voice_num)->set(m_val, offset); // FIXME: check range + ((TypedPort<Sample>*)_port)->set_value(_voice_num, _val, _time - start); + //((TypedPort<Sample>*)_port)->buffer(_voice_num)->set(_val, offset); // FIXME: check range } } @@ -75,20 +75,20 @@ SetPortValueEvent::execute(SampleCount nframes, FrameTime start, FrameTime end) void SetPortValueEvent::post_process() { - if (m_error == NO_ERROR) { - assert(m_port != NULL); + if (_error == NO_ERROR) { + assert(_port != NULL); _responder->respond_ok(); - _engine.broadcaster()->send_control_change(m_port_path, m_val); + _engine.broadcaster()->send_control_change(_port_path, _val); - } else if (m_error == PORT_NOT_FOUND) { + } else if (_error == PORT_NOT_FOUND) { string msg = "Unable to find port "; - msg.append(m_port_path).append(" for set_port_value"); + msg.append(_port_path).append(" for set_port_value"); _responder->respond_error(msg); - } else if (m_error == TYPE_MISMATCH) { + } else if (_error == TYPE_MISMATCH) { string msg = "Attempt to set "; - msg.append(m_port_path).append(" to incompatible type"); + msg.append(_port_path).append(" to incompatible type"); _responder->respond_error(msg); } } diff --git a/src/libs/engine/events/SetPortValueEvent.h b/src/libs/engine/events/SetPortValueEvent.h index ed4bb86e..63f82a41 100644 --- a/src/libs/engine/events/SetPortValueEvent.h +++ b/src/libs/engine/events/SetPortValueEvent.h @@ -43,11 +43,11 @@ public: private: enum ErrorType { NO_ERROR, PORT_NOT_FOUND, TYPE_MISMATCH }; - int m_voice_num; - string m_port_path; - float m_val; - Port* m_port; - ErrorType m_error; + int _voice_num; + string _port_path; + float _val; + Port* _port; + ErrorType _error; }; diff --git a/src/libs/engine/events/SetPortValueQueuedEvent.cpp b/src/libs/engine/events/SetPortValueQueuedEvent.cpp index 2d7deeef..688455aa 100644 --- a/src/libs/engine/events/SetPortValueQueuedEvent.cpp +++ b/src/libs/engine/events/SetPortValueQueuedEvent.cpp @@ -30,22 +30,22 @@ namespace Ingen { */ SetPortValueQueuedEvent::SetPortValueQueuedEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, size_t voice_num, const string& port_path, Sample val) : QueuedEvent(engine, responder, timestamp), - m_voice_num(voice_num), - m_port_path(port_path), - m_val(val), - m_port(NULL), - m_error(NO_ERROR) + _voice_num(voice_num), + _port_path(port_path), + _val(val), + _port(NULL), + _error(NO_ERROR) { } SetPortValueQueuedEvent::SetPortValueQueuedEvent(Engine& engine, SharedPtr<Responder> responder, SampleCount timestamp, const string& port_path, Sample val) : QueuedEvent(engine, responder, timestamp), - m_voice_num(-1), - m_port_path(port_path), - m_val(val), - m_port(NULL), - m_error(NO_ERROR) + _voice_num(-1), + _port_path(port_path), + _val(val), + _port(NULL), + _error(NO_ERROR) { } @@ -53,13 +53,13 @@ SetPortValueQueuedEvent::SetPortValueQueuedEvent(Engine& engine, SharedPtr<Respo void SetPortValueQueuedEvent::pre_process() { - if (m_port == NULL) - m_port = _engine.object_store()->find_port(m_port_path); + if (_port == NULL) + _port = _engine.object_store()->find_port(_port_path); - if (m_port == NULL) { - m_error = PORT_NOT_FOUND; - } else if ( !(m_port->type() == DataType::FLOAT) ) { - m_error = TYPE_MISMATCH; + if (_port == NULL) { + _error = PORT_NOT_FOUND; + } else if ( !(_port->type() == DataType::FLOAT) ) { + _error = TYPE_MISMATCH; } QueuedEvent::pre_process(); @@ -72,12 +72,12 @@ SetPortValueQueuedEvent::execute(SampleCount nframes, FrameTime start, FrameTime QueuedEvent::execute(nframes, start, end); assert(_time >= start && _time <= end); - if (m_error == NO_ERROR) { - assert(m_port != NULL); - if (m_voice_num == -1) - ((TypedPort<Sample>*)m_port)->set_value(m_val, _time - start); + if (_error == NO_ERROR) { + assert(_port != NULL); + if (_voice_num == -1) + ((TypedPort<Sample>*)_port)->set_value(_val, _time - start); else - ((TypedPort<Sample>*)m_port)->buffer(m_voice_num)->set(m_val, _time - start); // FIXME: check range + ((TypedPort<Sample>*)_port)->buffer(_voice_num)->set(_val, _time - start); // FIXME: check range } } @@ -85,27 +85,27 @@ SetPortValueQueuedEvent::execute(SampleCount nframes, FrameTime start, FrameTime void SetPortValueQueuedEvent::post_process() { - if (m_error == NO_ERROR) { - assert(m_port != NULL); + if (_error == NO_ERROR) { + assert(_port != NULL); _responder->respond_ok(); - _engine.broadcaster()->send_control_change(m_port_path, m_val); + _engine.broadcaster()->send_control_change(_port_path, _val); // Send patch port control change, if this is a bridge port - /*Port* parent_port = m_port->parent_node()->as_port(); + /*Port* parent_port = _port->parent_node()->as_port(); if (parent_port != NULL) { assert(parent_port->type() == DataType::FLOAT); - _engine.broadcaster()->send_control_change(parent_port->path(), m_val); + _engine.broadcaster()->send_control_change(parent_port->path(), _val); }*/ - } else if (m_error == PORT_NOT_FOUND) { + } else if (_error == PORT_NOT_FOUND) { string msg = "Unable to find port "; - msg.append(m_port_path).append(" for set_port_value_slow"); + msg.append(_port_path).append(" for set_port_value_slow"); _responder->respond_error(msg); - } else if (m_error == TYPE_MISMATCH) { + } else if (_error == TYPE_MISMATCH) { string msg = "Attempt to set "; - msg.append(m_port_path).append(" to incompatible type"); + msg.append(_port_path).append(" to incompatible type"); _responder->respond_error(msg); } } diff --git a/src/libs/engine/events/SetPortValueQueuedEvent.h b/src/libs/engine/events/SetPortValueQueuedEvent.h index 118899dd..742f84bb 100644 --- a/src/libs/engine/events/SetPortValueQueuedEvent.h +++ b/src/libs/engine/events/SetPortValueQueuedEvent.h @@ -44,11 +44,11 @@ public: private: enum ErrorType { NO_ERROR, PORT_NOT_FOUND, TYPE_MISMATCH }; - int m_voice_num; - string m_port_path; - float m_val; - Port* m_port; - ErrorType m_error; + int _voice_num; + string _port_path; + float _val; + Port* _port; + ErrorType _error; }; |