#include <string>
-
-#include "pbd/failed_constructor.h"
#include "pbd/xml++.h"
-#include "ardour/audioengine.h"
#include "ardour/audio_port.h"
-#include "ardour/buffer_set.h"
+#include "ardour/audioengine.h"
#include "ardour/delivery.h"
+#include "ardour/io.h"
#include "ardour/mtdm.h"
-#include "ardour/plugin.h"
-#include "ardour/port.h"
#include "ardour/port_insert.h"
-#include "ardour/route.h"
#include "ardour/session.h"
#include "ardour/types.h"
}
PortInsert::PortInsert (Session& s, boost::shared_ptr<Pannable> pannable, boost::shared_ptr<MuteMaster> 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;
_measured_latency = 0;
}
-PortInsert::PortInsert (Session& s, const std::string& name, uint32_t bslot, boost::shared_ptr<Pannable> pannable, boost::shared_ptr<MuteMaster> mm)
- : IOProcessor (s, true, true, name, "")
- , _out (new Delivery (s, _output, pannable, mm, _name, Delivery::Insert))
- , _bitslot (bslot)
-{
- _mtdm = 0;
- _latency_detect = false;
- _latency_flush_frames = false;
- _measured_latency = 0;
-}
-
PortInsert::~PortInsert ()
{
_session.unmark_insert_id (_bitslot);
void
PortInsert::start_latency_detection ()
{
- if (_mtdm != 0) {
- delete _mtdm;
- }
-
- _mtdm = new MTDM;
+ delete _mtdm;
+ _mtdm = new MTDM (_session.frame_rate());
_latency_flush_frames = false;
_latency_detect = true;
_measured_latency = 0;
Sample* out = outbuf.data();
_mtdm->process (nframes, in, out);
-
+
outbuf.set_is_silent (false);
+ outbuf.set_written (true);
}
return;
_out->deactivate ();
}
-
-/** Set up the XML description of a send so that we will not
- * reset its name or bitslot during ::set_state()
- * @param state XML insert state.
- */
-
-void
-PortInsert::make_unique (XMLNode &state)
-{
- state.add_property ("ignore-bitslot", "1");
- state.add_property ("ignore-name", "1");
-}