summaryrefslogtreecommitdiffstats
path: root/src/server/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-08-01 17:51:16 +0200
committerDavid Robillard <d@drobilla.net>2020-08-02 01:48:48 +0200
commitd13e41341f687b9f526887aba7e664d71ae34aec (patch)
tree2f68f12e6c182169ad840b1710fa3e376c47ed00 /src/server/InputPort.cpp
parent95ceaf902f95baa431cdda972c0ebb48293e2022 (diff)
downloadingen-d13e41341f687b9f526887aba7e664d71ae34aec.tar.gz
ingen-d13e41341f687b9f526887aba7e664d71ae34aec.tar.bz2
ingen-d13e41341f687b9f526887aba7e664d71ae34aec.zip
Use consistent naming for context parameters
Diffstat (limited to 'src/server/InputPort.cpp')
-rw-r--r--src/server/InputPort.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index 15df4d60..d238398a 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -57,9 +57,9 @@ InputPort::InputPort(BufferFactory& bufs,
}
bool
-InputPort::apply_poly(RunContext& context, const uint32_t poly)
+InputPort::apply_poly(RunContext& ctx, const uint32_t poly)
{
- const bool ret = PortImpl::apply_poly(context, poly);
+ const bool ret = PortImpl::apply_poly(ctx, poly);
(void)ret;
assert(_voices->size() >= (ret ? poly : 1));
@@ -144,37 +144,37 @@ InputPort::max_tail_poly(RunContext&) const
}
void
-InputPort::pre_process(RunContext& context)
+InputPort::pre_process(RunContext& ctx)
{
if (_arcs.empty()) {
// No incoming arcs, just handle user-set value
for (uint32_t v = 0; v < _poly; ++v) {
// Update set state
- update_set_state(context, v);
+ update_set_state(ctx, v);
// Prepare for write in case a set event executes this cycle
if (!_parent->is_main()) {
- buffer(v)->prepare_write(context);
+ buffer(v)->prepare_write(ctx);
}
}
} 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(context, v);
+ _voices->at(v).buffer = _arcs.front().buffer(ctx, v);
}
} else {
// Mix down to local buffers in pre_run()
for (uint32_t v = 0; v < _poly; ++v) {
- buffer(v)->prepare_write(context);
+ buffer(v)->prepare_write(ctx);
}
}
}
void
-InputPort::pre_run(RunContext& context)
+InputPort::pre_run(RunContext& ctx)
{
if ((_user_buffer || !_arcs.empty()) && !direct_connect()) {
- const uint32_t src_poly = max_tail_poly(context);
+ const uint32_t src_poly = max_tail_poly(ctx);
const uint32_t max_n_srcs = _arcs.size() * src_poly + 1;
for (uint32_t v = 0; v < _poly; ++v) {
@@ -196,24 +196,24 @@ 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(context, w).get();
+ srcs[n_srcs++] = arc.buffer(ctx, 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(context, v).get();
+ srcs[n_srcs++] = arc.buffer(ctx, v).get();
assert(srcs[n_srcs - 1]);
}
}
// Then mix them into our buffer for this voice
- mix(context, buffer(v).get(), srcs, n_srcs);
- update_values(context.offset(), v);
+ mix(ctx, buffer(v).get(), srcs, n_srcs);
+ update_values(ctx.offset(), v);
}
} else if (is_a(PortType::CONTROL)) {
for (uint32_t v = 0; v < _poly; ++v) {
- update_values(context.offset(), v);
+ update_values(ctx.offset(), v);
}
}
}
@@ -238,10 +238,10 @@ InputPort::next_value_offset(SampleCount offset, SampleCount end) const
}
void
-InputPort::post_process(RunContext& context)
+InputPort::post_process(RunContext& ctx)
{
if (!_arcs.empty() || _force_monitor_update) {
- monitor(context, _force_monitor_update);
+ monitor(ctx, _force_monitor_update);
_force_monitor_update = false;
}