#include "ardour/session.h"
#include "ardour/sidechain.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
using namespace ARDOUR;
using namespace PBD;
SideChain::SideChain (Session& s, const std::string& name)
: IOProcessor (s, true, false, name)
{
-
}
SideChain::~SideChain ()
{
+ disconnect ();
}
XMLNode&
-SideChain::state(bool full)
+SideChain::state (bool full)
{
- XMLNode& node = IOProcessor::state(full);
+ XMLNode& node = IOProcessor::state (full);
node.add_property ("type", "sidechain");
return node;
}
int
SideChain::set_state (const XMLNode& node, int version)
{
- XMLNodeList nlist = node.children();
- const XMLNode* insert_node = &node;
-
- for (XMLNodeIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
- if ((*niter)->name() == "IOProcessor") {
- insert_node = *niter;
- }
- }
-
- IOProcessor::set_state (*insert_node, version);
-
+ IOProcessor::set_state (node, version);
return 0;
}
void
-SideChain::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, pframes_t nframes, bool)
+SideChain::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, double /*speed*/, pframes_t nframes, bool)
{
- if (_input->n_ports() == ChanCount::ZERO) {
+ if (_input->n_ports () == ChanCount::ZERO) {
// inplace pass-through
return;
}
- if ((!_active && !_pending_active)) {
+ if (!_active && !_pending_active) {
// zero buffers
- for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
- for (uint32_t out = _configured_input.get (*t); out < bufs.count().get (*t); ++out) {
+ for (DataType::iterator t = DataType::begin (); t != DataType::end (); ++t) {
+ for (uint32_t out = _configured_input.get (*t); out < bufs.count ().get (*t); ++out) {
bufs.get (*t, out).silence (nframes);
}
}
}
_input->collect_input (bufs, nframes, _configured_input);
- bufs.set_count(_configured_output);
+ bufs.set_count (_configured_output);
_active = _pending_active;
}
bool
SideChain::can_support_io_configuration (const ChanCount& in, ChanCount& out)
{
- out = in + _input->n_ports();
+ out = in + _input->n_ports ();
return true;
}
bool
SideChain::configure_io (ChanCount in, ChanCount out)
{
- if (out != in + _input->n_ports()) {
- return false;
+ if (out != in + _input->n_ports ()) {
+ /* disabled for now - see PluginInsert::configure_io() */
+ // return false;
}
- Processor::configure_io(in, out);
- return true;
+ return Processor::configure_io (in, out);
}