using namespace ARDOUR;
using namespace PBD;
-Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm)
- : Delivery (s, mm, string_compose (_("send %1"), (_bitslot = s.next_send_id()) + 1), Delivery::Send)
+Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm, Role r)
+ : Delivery (s, mm, string_compose (_("send %1"), (_bitslot = s.next_send_id()) + 1), r)
, _metering (false)
{
_amp.reset (new Amp (_session, _mute_master));
ProcessorCreated (this); /* EMIT SIGNAL */
}
-Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node)
- : Delivery (s, mm, "send", Delivery::Send)
+Send::Send (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node, Role r)
+ : Delivery (s, mm, "send", r)
, _metering (false)
{
_amp.reset (new Amp (_session, _mute_master));
}
void
-Send::run_in_place (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+Send::activate ()
+{
+ _amp->activate ();
+ _meter->activate ();
+
+ Processor::activate ();
+}
+
+void
+Send::deactivate ()
+{
+ _amp->deactivate ();
+ _meter->deactivate ();
+
+ Processor::deactivate ();
+}
+
+void
+Send::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
{
if (!_active || _output->n_ports() == ChanCount::ZERO) {
_meter->reset ();
// Can't automate gain for sends or returns yet because we need different buffers
// so that we don't overwrite the main automation data for the route amp
// _amp->setup_gain_automation (start_frame, end_frame, nframes);
- _amp->run_in_place (sendbufs, start_frame, end_frame, nframes);
+ _amp->run (sendbufs, start_frame, end_frame, nframes);
/* deliver to outputs */
- Delivery::run_in_place (sendbufs, start_frame, end_frame, nframes);
+ Delivery::run (sendbufs, start_frame, end_frame, nframes);
/* consider metering */
if (_amp->gain_control()->get_value() == 0) {
_meter->reset();
} else {
- _meter->run_in_place (*_output_buffers, start_frame, end_frame, nframes);
+ _meter->run (*_output_buffers, start_frame, end_frame, nframes);
}
}
}
XMLNode&
Send::state(bool full)
{
- XMLNode& node = IOProcessor::state(full);
+ XMLNode& node = Delivery::state(full);
char buf[32];
+
node.add_property ("type", "send");
snprintf (buf, sizeof (buf), "%" PRIu32, _bitslot);
node.add_property ("bitslot", buf);
bool
Send::can_support_io_configuration (const ChanCount& in, ChanCount& out) const
{
- if (_output->n_ports() == ChanCount::ZERO) {
-
- /* not configured yet, we can support anything */
-
- out = in;
- return true; /* we can support anything the first time we're asked */
-
- } else {
-
- /* for a send, processor input corresponds to IO output */
+ /* sends have no impact at all on the channel configuration of the
+ streams passing through the route. so, out == in.
+ */
+
+ out = in;
+ return true;
+}
- out = in;
- return true;
+bool
+Send::configure_io (ChanCount in, ChanCount out)
+{
+ if (!_amp->configure_io (in, out) || !_meter->configure_io (in, out)) {
+ return false;
}
-
- return false;
+
+ return Processor::configure_io (in, out);
}
/** Set up the XML description of a send so that its name is unique.
state.property("name")->set_value (name);
XMLNode* io = state.child ("IO");
+
if (io) {
io->property("name")->set_value (name);
}
bool
Send::set_name (const std::string& new_name)
{
- char buf[32];
std::string unique_name;
- snprintf (buf, sizeof (buf), "%u", _bitslot);
- unique_name = new_name;
- unique_name += buf;
+ if (_role == Delivery::Send) {
+ char buf[32];
+ snprintf (buf, sizeof (buf), "%u", _bitslot);
+ unique_name = new_name;
+ unique_name += buf;
+ } else {
+ unique_name = new_name;
+ }
return Delivery::set_name (unique_name);
}
+
+bool
+Send::visible () const
+{
+ if (_role == Listen) {
+ return false;
+ }
+
+ return true;
+}