more MTC debugging
[ardour.git] / libs / ardour / midi_clock_slave.cc
index 53f819e54adf9fe7e4c657be89aba58e639ffa32..3a43580d648c79fe028311fae3c884268799aa9d 100644 (file)
@@ -39,7 +39,6 @@
 
 using namespace std;
 using namespace ARDOUR;
-using namespace sigc;
 using namespace MIDI;
 using namespace PBD;
 
@@ -63,27 +62,25 @@ MIDIClock_Slave::MIDIClock_Slave (ISlaveSessionProxy* session_proxy, int ppqn)
 
 MIDIClock_Slave::~MIDIClock_Slave()
 {
-  delete session;
+       delete session;
 }
 
 void
 MIDIClock_Slave::rebind (MIDI::Port& p)
 {
-       for (vector<sigc::connection>::iterator i = connections.begin(); i != connections.end(); ++i) {
-               (*i).disconnect ();
-       }
+       port_connections.drop_connections();
 
        port = &p;
 
-       #ifdef DEBUG_MIDI_CLOCK
-               std::cerr << "MIDIClock_Slave: connecting to port " << port->name() << std::endl;
-       #endif
+#ifdef DEBUG_MIDI_CLOCK
+       std::cerr << "MIDIClock_Slave: connecting to port " << port->name() << std::endl;
+#endif
 
-       connections.push_back (port->input()->timing.connect   (mem_fun (*this, &MIDIClock_Slave::update_midi_clock)));
-       connections.push_back (port->input()->start.connect    (mem_fun (*this, &MIDIClock_Slave::start)));
-       connections.push_back (port->input()->contineu.connect (mem_fun (*this, &MIDIClock_Slave::contineu)));
-       connections.push_back (port->input()->stop.connect     (mem_fun (*this, &MIDIClock_Slave::stop)));
-       connections.push_back (port->input()->position.connect (mem_fun (*this, &MIDIClock_Slave::position)));
+       port->input()->timing.connect_same_thread (port_connections, boost::bind (&MIDIClock_Slave::update_midi_clock, this, _1, _2));
+       port->input()->start.connect_same_thread (port_connections, boost::bind (&MIDIClock_Slave::start, this, _1, _2));
+       port->input()->contineu.connect_same_thread (port_connections, boost::bind (&MIDIClock_Slave::contineu, this, _1, _2));
+       port->input()->stop.connect_same_thread (port_connections, boost::bind (&MIDIClock_Slave::stop, this, _1, _2));
+       port->input()->position.connect_same_thread (port_connections, boost::bind (&MIDIClock_Slave::position, this, _1, _2, 3));
 }
 
 void