summaryrefslogtreecommitdiffstats
path: root/src/server/InputPort.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/InputPort.hpp')
-rw-r--r--src/server/InputPort.hpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/server/InputPort.hpp b/src/server/InputPort.hpp
index 1a27ac93..59e79463 100644
--- a/src/server/InputPort.hpp
+++ b/src/server/InputPort.hpp
@@ -85,14 +85,17 @@ public:
ArcImpl* remove_arc(RunContext& context,
const PortImpl* tail);
- /** Set `voices` as the buffers to be used for this port.
+ /** Like `get_buffers`, but for the pre-process thread.
*
- * @return true iff buffers are locally owned by the port
+ * This uses the "current" number of arcs fromthe perspective of the
+ * pre-process thread to allocate buffers for application of a
+ * connection/disconnection/etc in the next process cycle.
*/
- bool get_buffers(BufferFactory& bufs,
- Raul::Array<Voice>* voices,
- uint32_t poly,
- bool real_time) const;
+ bool pre_get_buffers(BufferFactory& bufs,
+ Raul::Array<Voice>* voices,
+ uint32_t poly) const;
+
+ bool setup_buffers(RunContext& ctx, BufferFactory& bufs, uint32_t poly) override;
/** Set up buffer pointers. */
void pre_process(RunContext& context);
@@ -106,13 +109,19 @@ public:
SampleCount next_value_offset(SampleCount offset, SampleCount end) const;
void update_values(SampleCount offset, uint32_t voice);
- size_t num_arcs() const { return _num_arcs; } ///< Pre-process thread
- void increment_num_arcs() { ++_num_arcs; }
- void decrement_num_arcs() { --_num_arcs; }
+ size_t num_arcs() const override { return _num_arcs; }
+ void increment_num_arcs() { ++_num_arcs; }
+ void decrement_num_arcs() { --_num_arcs; }
bool direct_connect() const;
protected:
+ bool get_buffers(BufferFactory& bufs,
+ PortImpl::GetFn get,
+ Raul::Array<Voice>* voices,
+ uint32_t poly,
+ size_t num_in_arcs) const override;
+
size_t _num_arcs; ///< Pre-process thread
Arcs _arcs; ///< Audio thread
};