From 4a9a5dea2658bb6a88f2eb74e32b264586ce2e32 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 10 Dec 2010 16:31:14 +0000 Subject: prevent the monitor inputs from showing up in the port matrix, fo'real git-svn-id: svn://localhost/ardour2/branches/3.0@8235 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/port_group.cc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'gtk2_ardour/port_group.cc') diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index c52a76d2c5..2d94fa063f 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -19,6 +19,7 @@ #include #include +#include #include "midi++/manager.h" #include "midi++/mmc.h" @@ -493,6 +494,11 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp std::vector extra_system[DataType::num_types]; std::vector extra_other[DataType::num_types]; + string lpn (PROGRAM_NAME); + boost::to_lower (lpn); + string lpnc = lpn; + lpnc += ':'; + const char ** ports = 0; if (type == DataType::NIL) { ports = session->engine().get_ports ("", "", inputs ? JackPortIsInput : JackPortIsOutput); @@ -524,13 +530,28 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp continue; } + /* special hack: ignore our monitor inputs (which show up here because + we excluded them earlier. + */ + + string lp = p; + boost::to_lower (lp); + + if ((lp.find (N_(":monitor")) != string::npos) && + (lp.find (lpn) != string::npos)) { + ++n; + continue; + } + /* can't use the audio engine for this as we are looking at non-Ardour ports */ jack_port_t* jp = jack_port_by_name (session->engine().jack(), p.c_str()); if (jp) { DataType t (jack_port_type (jp)); if (t != DataType::NIL) { - if (port_has_prefix (p, "system:") || port_has_prefix (p, "alsa_pcm") || port_has_prefix (p, "ardour:")) { + if (port_has_prefix (p, N_("system:")) || + port_has_prefix (p, N_("alsa_pcm")) || + port_has_prefix (p, lpnc)) { extra_system[t].push_back (p); } else { extra_other[t].push_back (p); -- cgit v1.2.3