From 399ddfc5b1d4f1f131362d0439821778c6681b23 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 30 Sep 2007 21:12:16 +0000 Subject: Better design for process() signature (pass everything needed in a single object parameter). Working port "monitoring" (connect an output to a control input, GUI will animate controller). git-svn-id: http://svn.drobilla.net/lad/ingen@788 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/OutputPort.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/libs/engine/OutputPort.cpp') diff --git a/src/libs/engine/OutputPort.cpp b/src/libs/engine/OutputPort.cpp index b7da8956..260f3038 100644 --- a/src/libs/engine/OutputPort.cpp +++ b/src/libs/engine/OutputPort.cpp @@ -23,27 +23,23 @@ namespace Ingen { void -OutputPort::pre_process(SampleCount nframes, FrameTime start, FrameTime end) +OutputPort::pre_process(ProcessContext& context) { for (uint32_t i=0; i < _poly; ++i) - _buffers->at(i)->prepare_write(nframes); + _buffers->at(i)->prepare_write(context.nframes()); } void -OutputPort::process(ProcessContext& context, SampleCount nframes, FrameTime start, FrameTime end) +OutputPort::post_process(ProcessContext& context) { if (_monitor && _type == DataType::FLOAT && _buffer_size == 1) { - context.event_sink().control_change(this, ((AudioBuffer*)(*_buffers)[0])->value_at(0)); + context.event_sink().control_change(this, context.start(), + ((AudioBuffer*)(*_buffers)[0])->value_at(0)); } -} - -void -OutputPort::post_process(SampleCount nframes, FrameTime start, FrameTime end) -{ for (uint32_t i=0; i < _poly; ++i) - _buffers->at(i)->prepare_read(nframes); + _buffers->at(i)->prepare_read(context.nframes()); } -- cgit v1.2.1