X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fport_insert.cc;h=c352e22e55a6c83ba98cd28c02bb0ff2713094bb;hb=f8737f701264c8514006c7dbbf26025b62f98e39;hp=05d0aa3c6f2ba06aa85531328271f07d222a7a18;hpb=162d672769f648f33e89c6f666cf927b32f5ef3f;p=ardour.git diff --git a/libs/ardour/port_insert.cc b/libs/ardour/port_insert.cc index 05d0aa3c6f..c352e22e55 100644 --- a/libs/ardour/port_insert.cc +++ b/libs/ardour/port_insert.cc @@ -44,12 +44,12 @@ PortInsert::name_and_id_new_insert (Session& s, uint32_t& bitslot) } PortInsert::PortInsert (Session& s, boost::shared_ptr pannable, boost::shared_ptr mm) - : IOProcessor (s, true, true, name_and_id_new_insert (s, _bitslot), "") + : IOProcessor (s, true, true, name_and_id_new_insert (s, _bitslot), "", DataType::AUDIO, true) , _out (new Delivery (s, _output, pannable, mm, _name, Delivery::Insert)) { _mtdm = 0; _latency_detect = false; - _latency_flush_frames = false; + _latency_flush_frames = 0; _measured_latency = 0; } @@ -63,8 +63,8 @@ void PortInsert::start_latency_detection () { delete _mtdm; - _mtdm = new MTDM; - _latency_flush_frames = false; + _mtdm = new MTDM (_session.frame_rate()); + _latency_flush_frames = 0; _latency_detect = true; _measured_latency = 0; } @@ -72,7 +72,7 @@ PortInsert::start_latency_detection () void PortInsert::stop_latency_detection () { - _latency_flush_frames = signal_latency() + _session.engine().frames_per_cycle(); + _latency_flush_frames = signal_latency() + _session.engine().samples_per_cycle(); _latency_detect = false; } @@ -93,7 +93,7 @@ PortInsert::latency() const */ if (_measured_latency == 0) { - return _session.engine().frames_per_cycle() + _input->latency(); + return _session.engine().samples_per_cycle() + _input->latency(); } else { return _measured_latency; } @@ -116,7 +116,7 @@ PortInsert::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, _mtdm->process (nframes, in, out); - outbuf.set_is_silent (false); + outbuf.set_written (true); } return; @@ -239,7 +239,7 @@ PortInsert::signal_latency() const */ if (_measured_latency == 0) { - return _session.engine().frames_per_cycle() + _input->signal_latency(); + return _session.engine().samples_per_cycle() + _input->signal_latency(); } else { return _measured_latency; } @@ -265,7 +265,7 @@ PortInsert::configure_io (ChanCount in, ChanCount out) } bool -PortInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) const +PortInsert::can_support_io_configuration (const ChanCount& in, ChanCount& out) { out = in; return true;