diff options
author | David Robillard <d@drobilla.net> | 2012-04-28 02:25:35 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-28 02:25:35 +0000 |
commit | 927b169eb1787bc40ede591c7c7893a39b488d95 (patch) | |
tree | 70337e073d9ddd301e118bbda6b43481e88de4ed /src/server/events | |
parent | eed06c66b6f54687cc148d45d00352a85ad2d3d3 (diff) | |
download | ingen-927b169eb1787bc40ede591c7c7893a39b488d95.tar.gz ingen-927b169eb1787bc40ede591c7c7893a39b488d95.tar.bz2 ingen-927b169eb1787bc40ede591c7c7893a39b488d95.zip |
Use "tail" and "head" terminology instead of "src_port" and "dst_port".
Use the same types for connect() and disconnect() parameters.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4292 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/events')
-rw-r--r-- | src/server/events/Connect.cpp | 24 | ||||
-rw-r--r-- | src/server/events/Connect.hpp | 8 | ||||
-rw-r--r-- | src/server/events/Disconnect.cpp | 36 | ||||
-rw-r--r-- | src/server/events/Disconnect.hpp | 14 | ||||
-rw-r--r-- | src/server/events/DisconnectAll.cpp | 12 |
5 files changed, 47 insertions, 47 deletions
diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index f61a5cd1..6ad8d4f6 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -46,11 +46,11 @@ Connect::Connect(Engine& engine, Interface* client, int32_t id, SampleCount timestamp, - const Path& src_port_path, - const Path& dst_port_path) + const Path& tail_path, + const Path& head_path) : Event(engine, client, id, timestamp) - , _src_port_path(src_port_path) - , _dst_port_path(dst_port_path) + , _tail_path(tail_path) + , _head_path(head_path) , _patch(NULL) , _src_output_port(NULL) , _dst_input_port(NULL) @@ -63,24 +63,24 @@ Connect::pre_process() { Glib::RWLock::ReaderLock rlock(_engine.engine_store()->lock()); - PortImpl* src_port = _engine.engine_store()->find_port(_src_port_path); - PortImpl* dst_port = _engine.engine_store()->find_port(_dst_port_path); - if (!src_port || !dst_port) { + PortImpl* tail = _engine.engine_store()->find_port(_tail_path); + PortImpl* head = _engine.engine_store()->find_port(_head_path); + if (!tail || !head) { _status = PORT_NOT_FOUND; Event::pre_process(); return; } - _dst_input_port = dynamic_cast<InputPort*>(dst_port); - _src_output_port = dynamic_cast<OutputPort*>(src_port); + _dst_input_port = dynamic_cast<InputPort*>(head); + _src_output_port = dynamic_cast<OutputPort*>(tail); if (!_dst_input_port || !_src_output_port) { _status = DIRECTION_MISMATCH; Event::pre_process(); return; } - NodeImpl* const src_node = src_port->parent_node(); - NodeImpl* const dst_node = dst_port->parent_node(); + NodeImpl* const src_node = tail->parent_node(); + NodeImpl* const dst_node = head->parent_node(); if (!src_node || !dst_node) { _status = PARENT_NOT_FOUND; Event::pre_process(); @@ -176,7 +176,7 @@ Connect::post_process() { respond(_status); if (!_status) { - _engine.broadcaster()->connect(_src_port_path, _dst_port_path); + _engine.broadcaster()->connect(_tail_path, _head_path); } } diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index f4544272..d3c2bea6 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -52,16 +52,16 @@ public: Interface* client, int32_t id, SampleCount timestamp, - const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + const Raul::Path& tail, + const Raul::Path& head); void pre_process(); void execute(ProcessContext& context); void post_process(); private: - Raul::Path _src_port_path; - Raul::Path _dst_port_path; + Raul::Path _tail_path; + Raul::Path _head_path; PatchImpl* _patch; OutputPort* _src_output_port; diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index ddf3bb1c..b6432d0b 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -45,14 +45,14 @@ Disconnect::Disconnect(Engine& engine, Interface* client, int32_t id, SampleCount timestamp, - const Raul::Path& src_port_path, - const Raul::Path& dst_port_path) + const Raul::Path& tail_path, + const Raul::Path& head_path) : Event(engine, client, id, timestamp) - , _src_port_path(src_port_path) - , _dst_port_path(dst_port_path) + , _tail_path(tail_path) + , _head_path(head_path) , _patch(NULL) - , _src_port(NULL) - , _dst_port(NULL) + , _tail(NULL) + , _head(NULL) , _impl(NULL) , _compiled_patch(NULL) { @@ -115,25 +115,25 @@ Disconnect::pre_process() { Glib::RWLock::WriterLock lock(_engine.engine_store()->lock()); - 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()) { + if (_tail_path.parent().parent() != _head_path.parent().parent() + && _tail_path.parent() != _head_path.parent().parent() + && _tail_path.parent().parent() != _head_path.parent()) { _status = PARENT_DIFFERS; Event::pre_process(); return; } - _src_port = _engine.engine_store()->find_port(_src_port_path); - _dst_port = _engine.engine_store()->find_port(_dst_port_path); + _tail = _engine.engine_store()->find_port(_tail_path); + _head = _engine.engine_store()->find_port(_head_path); - if (_src_port == NULL || _dst_port == NULL) { + if (_tail == NULL || _head == NULL) { _status = PORT_NOT_FOUND; Event::pre_process(); return; } - NodeImpl* const src_node = _src_port->parent_node(); - NodeImpl* const dst_node = _dst_port->parent_node(); + NodeImpl* const src_node = _tail->parent_node(); + NodeImpl* const dst_node = _head->parent_node(); // Connection to a patch port from inside the patch if (src_node->parent_patch() != dst_node->parent_patch()) { @@ -155,7 +155,7 @@ Disconnect::pre_process() assert(_patch); - if (!_patch->has_connection(_src_port, _dst_port)) { + if (!_patch->has_connection(_tail, _head)) { _status = NOT_FOUND; Event::pre_process(); return; @@ -169,8 +169,8 @@ Disconnect::pre_process() _impl = new Impl(_engine, _patch, - dynamic_cast<OutputPort*>(_src_port), - dynamic_cast<InputPort*>(_dst_port)); + dynamic_cast<OutputPort*>(_tail), + dynamic_cast<InputPort*>(_head)); if (_patch->enabled()) _compiled_patch = _patch->compile(); @@ -228,7 +228,7 @@ Disconnect::post_process() { respond(_status); if (!_status) { - _engine.broadcaster()->disconnect(_src_port->path(), _dst_port->path()); + _engine.broadcaster()->disconnect(_tail->path(), _head->path()); } delete _impl; diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index 05ac2aa7..cf4e6f18 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -49,8 +49,8 @@ public: Interface* client, int32_t id, SampleCount timestamp, - const Raul::Path& src_port_path, - const Raul::Path& dst_port_path); + const Raul::Path& tail_path, + const Raul::Path& head_path); void pre_process(); void execute(ProcessContext& context); @@ -65,7 +65,7 @@ public: bool execute(ProcessContext& context, bool set_dst_buffers); - InputPort* dst_port() { return _dst_input_port; } + InputPort* head() { return _dst_input_port; } private: Engine& _engine; @@ -77,12 +77,12 @@ public: }; private: - const Raul::Path _src_port_path; - const Raul::Path _dst_port_path; + const Raul::Path _tail_path; + const Raul::Path _head_path; PatchImpl* _patch; - PortImpl* _src_port; - PortImpl* _dst_port; + PortImpl* _tail; + PortImpl* _head; Impl* _impl; CompiledPatch* _compiled_patch; diff --git a/src/server/events/DisconnectAll.cpp b/src/server/events/DisconnectAll.cpp index 08c0a9dc..123b218b 100644 --- a/src/server/events/DisconnectAll.cpp +++ b/src/server/events/DisconnectAll.cpp @@ -125,13 +125,13 @@ DisconnectAll::pre_process() i != _parent->connections().end(); ++i) { ConnectionImpl* const c = (ConnectionImpl*)i->second.get(); if (_node) { - if (c->src_port()->parent_node() == _node - || c->dst_port()->parent_node() == _node) { + if (c->tail()->parent_node() == _node + || c->head()->parent_node() == _node) { to_remove.insert(c); } } else { assert(_port); - if (c->src_port() == _port || c->dst_port() == _port) { + if (c->tail() == _port || c->head() == _port) { to_remove.insert(c); } } @@ -142,8 +142,8 @@ DisconnectAll::pre_process() i != to_remove.end(); ++i) { _impls.push_back(new Disconnect::Impl( _engine, _parent, - dynamic_cast<OutputPort*>((*i)->src_port()), - dynamic_cast<InputPort*>((*i)->dst_port()))); + dynamic_cast<OutputPort*>((*i)->tail()), + dynamic_cast<InputPort*>((*i)->head()))); } if (!_deleting && _parent->enabled()) @@ -160,7 +160,7 @@ DisconnectAll::execute(ProcessContext& context) if (_status == SUCCESS) { for (Impls::iterator i = _impls.begin(); i != _impls.end(); ++i) { (*i)->execute(context, - !_deleting || ((*i)->dst_port()->parent_node() != _node)); + !_deleting || ((*i)->head()->parent_node() != _node)); } } |