summaryrefslogtreecommitdiffstats
path: root/src/server/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-05-12 07:04:11 +0000
committerDavid Robillard <d@drobilla.net>2012-05-12 07:04:11 +0000
commit52011c3b045d9f49a4bc25c9f545bb35e5c2a0a9 (patch)
tree29012d7da9bf9e0525574b3d8713eaf828626ac5 /src/server/InputPort.cpp
parent2e8a9b483a8d2ca7ba2a4feb4a845a32ab1eebeb (diff)
downloadingen-52011c3b045d9f49a4bc25c9f545bb35e5c2a0a9.tar.gz
ingen-52011c3b045d9f49a4bc25c9f545bb35e5c2a0a9.tar.bz2
ingen-52011c3b045d9f49a4bc25c9f545bb35e5c2a0a9.zip
More work towards checking contexts via parameter rather than thread magic.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4376 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/InputPort.cpp')
-rw-r--r--src/server/InputPort.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index 4239ae89..29229eb0 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -78,12 +78,13 @@ InputPort::apply_poly(ProcessContext& context, Raul::Maid& maid, uint32_t poly)
* @return true iff buffers are locally owned by the port
*/
bool
-InputPort::get_buffers(BufferFactory& bufs,
+InputPort::get_buffers(Context& context,
+ BufferFactory& bufs,
Raul::Array<BufferRef>* buffers,
uint32_t poly) const
{
- size_t num_edges = (ThreadManager::thread_is(THREAD_PROCESS))
- ? _edges.size() : _num_edges;
+ const bool is_process_context = bufs.engine().is_process_context(context);
+ size_t num_edges = is_process_context ? _edges.size() : _num_edges;
if (is_a(PortType::AUDIO) && num_edges == 0) {
// Audio input with no edges, use shared zero buffer
@@ -92,7 +93,7 @@ InputPort::get_buffers(BufferFactory& bufs,
return false;
} else if (num_edges == 1) {
- if (ThreadManager::thread_is(THREAD_PROCESS)) {
+ if (is_process_context) {
if (!_edges.front().must_mix() &&
!_edges.front().must_queue()) {
// Single non-mixing conneciton, use buffers directly
@@ -105,7 +106,7 @@ InputPort::get_buffers(BufferFactory& bufs,
// Otherwise, allocate local buffers
for (uint32_t v = 0; v < poly; ++v) {
- buffers->at(v) = _bufs.get(buffer_type(), _buffer_size);
+ buffers->at(v) = _bufs.get(context, buffer_type(), _buffer_size);
buffers->at(v)->clear();
}
return true;