/*
- Copyright (C) 2006 Paul Davis
+ Copyright (C) 2006 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
using namespace ARDOUR;
using namespace std;
+framecnt_t AudioPort::_port_offset = 0;
+
AudioPort::AudioPort (const std::string& name, Flags flags)
: Port (name, DataType::AUDIO, flags)
, _buffer (new AudioBuffer (0))
}
void
-AudioPort::cycle_start (nframes_t nframes)
+AudioPort::cycle_start (pframes_t nframes)
{
/* 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
+ Inputs must be done in the correct processing order, which
+ requires interleaving with route processing. that will
happen when Port::get_buffer() is called.
*/
}
void
-AudioPort::cycle_end (nframes_t nframes)
+AudioPort::cycle_end (pframes_t nframes)
{
if (sends_output() && !_buffer->written()) {
_buffer->silence (nframes);
}
AudioBuffer&
-AudioPort::get_audio_buffer (nframes_t nframes, nframes_t offset)
+AudioPort::get_audio_buffer (framecnt_t nframes, framecnt_t offset)
{
/* caller must hold process lock */
*/
_buffer->set_data ((Sample *) jack_port_get_buffer (_jack_port, nframes) + offset + _port_offset, nframes);
- }
-
+ }
+
/* output ports set their _buffer data information during ::cycle_start()
*/
return *_buffer;
}
+size_t
+AudioPort::raw_buffer_size (pframes_t nframes) const
+{
+ return nframes * sizeof (Sample);
+}
+