summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-09-23 19:39:56 +0200
committerDavid Robillard <d@drobilla.net>2018-09-23 19:39:56 +0200
commit3d117ed9a00c3fdbcb07327d6669aa26c3821720 (patch)
treeabe73ae30112c9f9cd5c665bf618d84b6b8bf3bd
parent5a42be72e788864736425fbf1fe0e884767a483f (diff)
downloadingen-3d117ed9a00c3fdbcb07327d6669aa26c3821720.tar.gz
ingen-3d117ed9a00c3fdbcb07327d6669aa26c3821720.tar.bz2
ingen-3d117ed9a00c3fdbcb07327d6669aa26c3821720.zip
Enforce that arc buffer can only be accessed in run context
-rw-r--r--src/server/ArcImpl.cpp2
-rw-r--r--src/server/ArcImpl.hpp2
-rw-r--r--src/server/InputPort.cpp8
3 files changed, 6 insertions, 6 deletions
diff --git a/src/server/ArcImpl.cpp b/src/server/ArcImpl.cpp
index b92f817d..ffdddb8e 100644
--- a/src/server/ArcImpl.cpp
+++ b/src/server/ArcImpl.cpp
@@ -65,7 +65,7 @@ ArcImpl::head_path() const
}
BufferRef
-ArcImpl::buffer(uint32_t voice, SampleCount offset) const
+ArcImpl::buffer(const RunContext&, uint32_t voice) const
{
return _tail->buffer(std::min(voice, _tail->poly() - 1));
}
diff --git a/src/server/ArcImpl.hpp b/src/server/ArcImpl.hpp
index 49e9674b..54f88749 100644
--- a/src/server/ArcImpl.hpp
+++ b/src/server/ArcImpl.hpp
@@ -66,7 +66,7 @@ public:
* buffer, and will return accordingly (e.g. the same buffer for every
* voice in a mono->poly arc).
*/
- BufferRef buffer(uint32_t voice, SampleCount offset=0) const;
+ BufferRef buffer(const RunContext& ctx, uint32_t voice) const;
/** Whether this arc must mix down voices into a local buffer */
bool must_mix() const;
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index a9ff1738..76382270 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -115,7 +115,7 @@ InputPort::setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly)
if (_arcs.size() == 1 && !is_a(PortType::ATOM) && !_arcs.front().must_mix()) {
// Single non-mixing connection, use buffers directly
for (uint32_t v = 0; v < poly; ++v) {
- _voices->at(v).buffer = _arcs.front().buffer(v);
+ _voices->at(v).buffer = _arcs.front().buffer(ctx, v);
}
return false;
}
@@ -158,7 +158,7 @@ InputPort::pre_process(RunContext& context)
} else if (direct_connect()) {
// Directly connected, use source's buffer directly
for (uint32_t v = 0; v < _poly; ++v) {
- _voices->at(v).buffer = _arcs.front().buffer(v);
+ _voices->at(v).buffer = _arcs.front().buffer(context, v);
}
} else {
// Mix down to local buffers in pre_run()
@@ -194,13 +194,13 @@ InputPort::pre_run(RunContext& context)
// P -> 1 or 1 -> 1: all tail voices => each head voice
for (uint32_t w = 0; w < arc.tail()->poly(); ++w) {
assert(n_srcs < max_n_srcs);
- srcs[n_srcs++] = arc.buffer(w, context.offset()).get();
+ srcs[n_srcs++] = arc.buffer(context, w).get();
assert(srcs[n_srcs - 1]);
}
} else {
// P -> P or 1 -> P: tail voice => corresponding head voice
assert(n_srcs < max_n_srcs);
- srcs[n_srcs++] = arc.buffer(v, context.offset()).get();
+ srcs[n_srcs++] = arc.buffer(context, v).get();
assert(srcs[n_srcs - 1]);
}
}