#include <cstring>
#include <sigc++/signal.h>
#include <pbd/failed_constructor.h>
+#include <pbd/destructible.h>
#include <ardour/ardour.h>
#include <ardour/data_type.h>
#include <jack/jack.h>
/** Abstract base for ports
*/
-class Port : public virtual sigc::trackable {
+class Port : public virtual PBD::Destructible {
public:
enum Flags {
IsInput = JackPortIsInput,
std::set<Port*> _connections;
static AudioEngine* engine;
+
+ private:
+
+ void port_going_away (Port *);
};
class PortConnectableByName {
Port::~Port ()
{
+ drop_references ();
disconnect_all ();
}
result = _connections.insert (&other);
if (result.second) {
+ other.GoingAway.connect (sigc::bind (mem_fun (*this, &Port::port_going_away), &other));
return 0;
} else {
return 1;
return i;
}
+void
+Port::port_going_away (Port* p)
+{
+ /* caller must hold process lock */
+
+ disconnect (*p);
+}
+
//-------------------------------------
_ext_port->reset ();
}
}
+