summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_clock_slave.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2009-12-19 20:26:31 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2009-12-19 20:26:31 +0000
commitaae367b63c9b619db1e40f27dc334c6987219481 (patch)
tree142f6ffed6bb749e24a06343587cad6b966888bd /libs/ardour/midi_clock_slave.cc
parent67460c2af45d0455e64623572480c064445c2e5b (diff)
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
Diffstat (limited to 'libs/ardour/midi_clock_slave.cc')
-rw-r--r--libs/ardour/midi_clock_slave.cc20
1 files changed, 8 insertions, 12 deletions
diff --git a/libs/ardour/midi_clock_slave.cc b/libs/ardour/midi_clock_slave.cc
index 12d25ac9ae..7303059207 100644
--- a/libs/ardour/midi_clock_slave.cc
+++ b/libs/ardour/midi_clock_slave.cc
@@ -43,8 +43,7 @@ using namespace MIDI;
using namespace PBD;
MIDIClock_Slave::MIDIClock_Slave (Session& s, MIDI::Port& p, int ppqn)
- : port_connections (0)
- , ppqn (ppqn)
+ : ppqn (ppqn)
, bandwidth (30.0 / 60.0) // 1 BpM = 1 / 60 Hz
{
session = (ISlaveSessionProxy *) new SlaveSessionProxy(s);
@@ -54,7 +53,6 @@ MIDIClock_Slave::MIDIClock_Slave (Session& s, MIDI::Port& p, int ppqn)
MIDIClock_Slave::MIDIClock_Slave (ISlaveSessionProxy* session_proxy, int ppqn)
: session(session_proxy)
- , port_connections (0)
, ppqn (ppqn)
, bandwidth (30.0 / 60.0) // 1 BpM = 1 / 60 Hz
{
@@ -65,26 +63,24 @@ MIDIClock_Slave::MIDIClock_Slave (ISlaveSessionProxy* session_proxy, int ppqn)
MIDIClock_Slave::~MIDIClock_Slave()
{
delete session;
- delete port_connections;
}
void
MIDIClock_Slave::rebind (MIDI::Port& p)
{
- delete port_connections;
- port_connections = new ScopedConnectionList;
-
+ port_connections.drop_connections();
+
port = &p;
#ifdef DEBUG_MIDI_CLOCK
std::cerr << "MIDIClock_Slave: connecting to port " << port->name() << std::endl;
#endif
- port_connections->add_connection (port->input()->timing.connect (boost::bind (&MIDIClock_Slave::update_midi_clock, this, _1, _2)));
- port_connections->add_connection (port->input()->start.connect (boost::bind (&MIDIClock_Slave::start, this, _1, _2)));
- port_connections->add_connection (port->input()->contineu.connect (boost::bind (&MIDIClock_Slave::contineu, this, _1, _2)));
- port_connections->add_connection (port->input()->stop.connect (boost::bind (&MIDIClock_Slave::stop, this, _1, _2)));
- port_connections->add_connection (port->input()->position.connect (boost::bind (&MIDIClock_Slave::position, this, _1, _2, 3)));
+ port->input()->timing.connect (port_connections, boost::bind (&MIDIClock_Slave::update_midi_clock, this, _1, _2));
+ port->input()->start.connect (port_connections, boost::bind (&MIDIClock_Slave::start, this, _1, _2));
+ port->input()->contineu.connect (port_connections, boost::bind (&MIDIClock_Slave::contineu, this, _1, _2));
+ port->input()->stop.connect (port_connections, boost::bind (&MIDIClock_Slave::stop, this, _1, _2));
+ port->input()->position.connect (port_connections, boost::bind (&MIDIClock_Slave::position, this, _1, _2, 3));
}
void