From aae367b63c9b619db1e40f27dc334c6987219481 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 19 Dec 2009 20:26:31 +0000 Subject: use new syntax for connecting to backend signals that enforces explicit connection scope, plus a few other related matters git-svn-id: svn://localhost/ardour2/branches/3.0@6376 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/mtc_slave.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'libs/ardour/mtc_slave.cc') diff --git a/libs/ardour/mtc_slave.cc b/libs/ardour/mtc_slave.cc index 50ef5011ba..91ac47c883 100644 --- a/libs/ardour/mtc_slave.cc +++ b/libs/ardour/mtc_slave.cc @@ -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 -- cgit v1.2.3