use new syntax for connecting to backend signals that enforces explicit connection...
[ardour.git] / libs / ardour / mtc_slave.cc
index 50ef5011ba74dd83c5f0c096506cf7ad0f3aabb8..91ac47c883cbd676ddd53b8dd69527001515ea49 100644 (file)
@@ -52,7 +52,6 @@ const int MTC_Slave::frame_tolerance = 2;
 
 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;
@@ -71,8 +70,6 @@ MTC_Slave::MTC_Slave (Session& s, MIDI::Port& p)
 
 MTC_Slave::~MTC_Slave()
 {
-       delete port_connections;
-
        if (did_reset_tc_format) {
                session.config.set_timecode_format (saved_tc_format);
        }
@@ -91,14 +88,13 @@ MTC_Slave::give_slave_full_control_over_transport_speed() const
 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