set_name (sendto->name());
- _send_to->GoingAway.connect (mem_fun (*this, &InternalSend::send_to_going_away));
+ _send_to->DropReferences.connect_same_thread (*this, boost::bind (&InternalSend::send_to_going_away, this));
+ _send_to->NameChanged.connect_same_thread (*this, boost::bind (&InternalSend::send_to_name_changed, this));
}
InternalSend::InternalSend (Session& s, boost::shared_ptr<MuteMaster> mm, const XMLNode& node)
- : Send (s, mm, node, Delivery::Aux /* will be reset in set_state() */)
+ : Send (s, mm, node, Stateful::loading_state_version, Delivery::Aux /* will be reset in set_state() */),
+ target (0)
{
- set_state (node, Stateful::loading_state_version);
+ /* Send constructor will set its state, so here we just need to set up our own */
+ set_our_state (node, Stateful::loading_state_version);
}
InternalSend::~InternalSend ()
}
void
-InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes)
+InternalSend::run (BufferSet& bufs, sframes_t start_frame, sframes_t end_frame, nframes_t nframes, bool)
{
if ((!_active && !_pending_active) || !target || !_send_to) {
_meter->reset ();
Amp::apply_simple_gain (mixbufs, nframes, tgain);
}
-
// 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 (mixbufs, start_frame, end_frame, nframes);
+ _amp->run (mixbufs, start_frame, end_frame, nframes, true);
/* XXX NEED TO PAN */
if (_amp->gain_control()->get_value() == 0) {
_meter->reset();
} else {
- _meter->run (mixbufs, start_frame, end_frame, nframes);
+ _meter->run (mixbufs, start_frame, end_frame, nframes, true);
}
}
{
XMLNode& node (Send::state (full));
- /* this replaces any existing property */
+ /* this replaces any existing "type" property */
node.add_property ("type", "intsend");
}
int
-InternalSend::set_state (const XMLNode& node, int version)
+InternalSend::set_our_state (const XMLNode& node, int /*version*/)
{
const XMLProperty* prop;
- Send::set_state (node, version);
-
if ((prop = node.property ("target")) != 0) {
_send_to_id = prop->value();
*/
if (!IO::connecting_legal) {
- connect_c = IO::ConnectingLegal.connect (mem_fun (*this, &InternalSend::connect_when_legal));
+ IO::ConnectingLegal.connect_same_thread (connect_c, boost::bind (&InternalSend::connect_when_legal, this));
} else {
connect_when_legal ();
}
return 0;
}
+int
+InternalSend::set_state (const XMLNode& node, int version)
+{
+ Send::set_state (node, version);
+ return set_our_state (node, version);
+}
+
int
InternalSend::connect_when_legal ()
{
return false;
}
+
+void
+InternalSend::send_to_name_changed ()
+{
+ set_name (_send_to->name ());
+}