- Port::reset();
- if (_flags & JackPortIsOutput) {
- if (_buffer.capacity() > 0) {
- _buffer.clear();
- }
- assert(_buffer.silent());
+ /* caller must hold process lock */
+
+ /* get_buffer() must only be run on outputs here in cycle_start().
+
+ Inputs must be done in the correct processing order, which
+ requires interleaving with route processing. that will
+ happen when Port::get_buffer() is called.
+ */
+
+ if (sends_output()) {
+
+ /* Notice that cycle_start() is always run with the *entire* process cycle frame count,
+ so we do not bother to apply _port_offset here - we always want the address of the
+ entire JACK port buffer. We are not collecting data here - just noting the
+ address where we will write data later in the process cycle.
+ */
+
+ _buffer->set_data ((Sample *) jack_port_get_buffer (_jack_port, nframes), nframes);
+ _buffer->prepare ();