using namespace std;
using namespace ARDOUR;
-using namespace sigc;
using namespace MIDI;
using namespace PBD;
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