MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p)
: session (s)
- , port_connections (0)
{
can_notify_on_unknown_rate = true;
did_reset_tc_format = false;
MTC_Slave::~MTC_Slave()
{
- delete port_connections;
-
if (did_reset_tc_format) {
session.config.set_timecode_format (saved_tc_format);
}
void
MTC_Slave::rebind (MIDI::Port& p)
{
- delete port_connections;
- port_connections = new ScopedConnectionList;
+ port_connections.drop_connections ();
port = &p;
- port_connections->add_connection (port->input()->mtc_time.connect ( boost::bind (&MTC_Slave::update_mtc_time, this, _1, _2, _3)));
- port_connections->add_connection (port->input()->mtc_qtr.connect (boost::bind (&MTC_Slave::update_mtc_qtr, this, _1, _2, _3)));
- port_connections->add_connection (port->input()->mtc_status.connect (boost::bind (&MTC_Slave::update_mtc_status, this, _1)));
+ port->input()->mtc_time.connect (port_connections, boost::bind (&MTC_Slave::update_mtc_time, this, _1, _2, _3));
+ port->input()->mtc_qtr.connect (port_connections, boost::bind (&MTC_Slave::update_mtc_qtr, this, _1, _2, _3));
+ port->input()->mtc_status.connect (port_connections, boost::bind (&MTC_Slave::update_mtc_status, this, _1));
}
void