25 #include "ardour/debug.h"
43 , _pending_flush(false)
106 roold = (roold + 1) % (_bsiz + 1);
127 assert (
_bsiz >= pending_delay);
130 if (pending_delay !=
_delay || pending_flush) {
134 string_compose (
"Old %1 delay: %2 bufsiz: %3 offset-diff: %4 write-offset: %5 read-offset: %6\n",
140 Sample *
const data = i->data();
141 for (
pframes_t pos = 0; pos < fade_len; ++pos) {
143 buf[
_woff * chn + c ] = data[ pos ];
144 data[ pos ] = buf[
_roff * chn + c ] *
gain;
167 Sample *
const data = i->data();
168 for (
pframes_t pos = fade_len; pos < 2 * fade_len; ++pos) {
170 buf[
_woff * chn + c ] = data[ pos ];
171 data[ pos ] = buf[
_roff * chn + c ] *
gain;
181 string_compose (
"New %1 delay: %2 bufsiz: %3 offset-diff: %4 write-offset: %5 read-offset: %6\n",
189 Sample *
const data = i->data();
190 for (
pframes_t pos = p0; pos < nsamples; ++pos) {
191 buf[
_woff * chn + c ] = data[ pos ];
192 data[ pos ] = buf[
_roff * chn + c ];
218 if (*t > nsamples + delay_diff) {
219 *t -= nsamples + delay_diff;
237 if (ev.
time() >= nsamples) {
253 if (ev.
time() < nsamples) {
270 if (signal_delay < 0) {
272 cerr <<
"WARNING: latency compensation is not possible.\n";
281 if (signal_delay <=
_bsiz) {
288 cerr <<
"LatComp: buffer resize in progress. "<<
name() <<
"pending: "<<
_pending_bsiz <<
" want: " << signal_delay <<
"\n";
308 name(), signal_delay));
329 string_compose (
"configure IO: %1 Ain: %2 Aout: %3 Min: %4 Mout: %5\n",
framecnt_t _pending_delay
boost::shared_ptr< Sample > _buf
boost::shared_ptr< Sample > _pending_buf
void silence(framecnt_t nframes, framecnt_t offset=0)
XMLNode & state(bool full)
LIBARDOUR_API PBD::PropertyDescriptor< bool > gain
boost::shared_ptr< MidiBuffer > _midi_buf
ChanCount _configured_output
void set_delay(framecnt_t signal_delay)
midi_iterator midi_begin()
audio_iterator audio_begin()
iterator erase(const iterator &i)
virtual bool configure_io(ChanCount in, ChanCount out)
#define DEBUG_TRACE(bits, str)
void run(BufferSet &, framepos_t, framepos_t, pframes_t, bool)
audio_iterator audio_end()
bool can_support_io_configuration(const ChanCount &in, ChanCount &out)
XMLProperty * add_property(const char *name, const std::string &value)
bool configure_io(ChanCount in, ChanCount out)
virtual XMLNode & state(bool full)
LIBARDOUR_API uint64_t LatencyCompensation
bool insert_event(const Evoral::MIDIEvent< TimeType > &event)
std::string string_compose(const std::string &fmt, const T1 &o1)
ChanCount _configured_input