diff options
author | David Robillard <d@drobilla.net> | 2011-10-06 17:51:43 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-10-06 17:51:43 +0000 |
commit | bb12144cbfb8c06f502ce0f963edefbb6009aea9 (patch) | |
tree | 0fb098b714256e3f4fe8148d2893715de4f749bc /src/server/ConnectionImpl.cpp | |
parent | 5994178571afa3483d2a52ce78646d4161153ea5 (diff) | |
download | ingen-bb12144cbfb8c06f502ce0f963edefbb6009aea9.tar.gz ingen-bb12144cbfb8c06f502ce0f963edefbb6009aea9.tar.bz2 ingen-bb12144cbfb8c06f502ce0f963edefbb6009aea9.zip |
Use an intrusive linked list for InputPort connections.
This simplifies the code and avoids the overhead of allocating list nodes.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3532 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/ConnectionImpl.cpp')
-rw-r--r-- | src/server/ConnectionImpl.cpp | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/server/ConnectionImpl.cpp b/src/server/ConnectionImpl.cpp index 49c45f43..9bb0d4f5 100644 --- a/src/server/ConnectionImpl.cpp +++ b/src/server/ConnectionImpl.cpp @@ -66,6 +66,18 @@ ConnectionImpl::dump() const << "POLY: " << _src_port->poly() << " => " << _dst_port->poly() << endl; } +const Raul::Path& +ConnectionImpl::src_port_path() const +{ + return _src_port->path(); +} + +const Raul::Path& +ConnectionImpl::dst_port_path() const +{ + return _dst_port->path(); +} + void ConnectionImpl::get_sources(Context& context, uint32_t voice, boost::intrusive_ptr<Buffer>* srcs, uint32_t max_num_srcs, uint32_t& num_srcs) @@ -119,6 +131,31 @@ ConnectionImpl::queue(Context& context) } } +BufferFactory::Ref +ConnectionImpl::buffer(uint32_t voice) const +{ + assert(!must_mix()); + assert(!must_queue()); + assert(_src_port->poly() == 1 || _src_port->poly() > voice); + if (_src_port->poly() == 1) { + return _src_port->buffer(0); + } else { + return _src_port->buffer(voice); + } +} + +bool +ConnectionImpl::must_mix() const +{ + return _src_port->poly() > _dst_port->poly(); +} + +bool +ConnectionImpl::must_queue() const +{ + return _src_port->context() != _dst_port->context(); +} + bool ConnectionImpl::can_connect(const OutputPort* src, const InputPort* dst) { |