using namespace std;
using namespace Gtk;
using namespace ARDOUR;
+using namespace ARDOUR_UI_UTILS;
/** PortMatrix constructor.
* @param session Our session.
_session->engine().PortRegisteredOrUnregistered.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports, this), gui_context());
/* watch for route order keys changing, which changes the order of things in our global ports list(s) */
- Route::SyncOrderKeys.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports_proxy, this, _1), gui_context());
+ Route::SyncOrderKeys.connect (_session_connections, invalidator (*this), boost::bind (&PortMatrix::setup_global_ports_proxy, this), gui_context());
/* Part 3: other stuff */
void
PortMatrix::setup_global_ports ()
{
+ if (!_session || _session->deletion_in_progress()) return;
ENSURE_GUI_THREAD (*this, &PortMatrix::setup_global_ports)
for (int i = 0; i < 2; ++i) {
}
void
-PortMatrix::setup_global_ports_proxy (RouteSortOrderKey sk)
+PortMatrix::setup_global_ports_proxy ()
{
- if (sk == EditorSort) {
- /* Avoid a deadlock by calling this in an idle handler: see IOSelector::io_changed_proxy
- for a discussion.
- */
+ /* Avoid a deadlock by calling this in an idle handler: see IOSelector::io_changed_proxy
+ for a discussion.
+ */
- Glib::signal_idle().connect_once (sigc::mem_fun (*this, &PortMatrix::setup_global_ports));
- }
+ Glib::signal_idle().connect_once (sigc::mem_fun (*this, &PortMatrix::setup_global_ports));
}
void
bool
PortMatrix::can_add_channels (boost::shared_ptr<Bundle> b) const
{
- return io_from_bundle (b);
+ return io_from_bundle (b) != 0;
}
void
bool
PortMatrix::can_remove_channels (boost::shared_ptr<Bundle> b) const
{
- return io_from_bundle (b);
+ return io_from_bundle (b) != 0;
}
void
}
- /* NOTREACHED */
+ abort(); /* NOTREACHED */
return PortMatrixNode::NOT_ASSOCIATED;
}