diff options
author | Carl Hetherington <carl@carlh.net> | 2009-01-24 01:46:13 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-01-24 01:46:13 +0000 |
commit | ff656003a84201f4a9accf4f24233bee02642af2 (patch) | |
tree | cb6119f59a15d76a54221cbea979465781000244 /gtk2_ardour/port_group.cc | |
parent | 0187028eb0e7e3e42b9799b7e55388f1d099abdb (diff) |
Try to avoid adding system ports to the port matrix twice. Fix some whitespace problems.
git-svn-id: svn://localhost/ardour2/branches/3.0@4437 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_group.cc')
-rw-r--r-- | gtk2_ardour/port_group.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gtk2_ardour/port_group.cc b/gtk2_ardour/port_group.cc index c47bda3030..70fd5a1b84 100644 --- a/gtk2_ardour/port_group.cc +++ b/gtk2_ardour/port_group.cc @@ -178,7 +178,20 @@ PortGroupList::refresh () if (p.substr(0, strlen ("system:")) == "system:" || p.substr (0, strlen ("alsa_pcm:")) == "alsa_pcm:") { /* system: or alsa_pcm: prefix */ - _system.add_port (p); + + /* see if this port is already in one of the system: bundles */ + std::vector<boost::shared_ptr<ARDOUR::Bundle> >::iterator i = _system.bundles.begin(); + while (i != _system.bundles.end()) { + if ((*i)->uses_port (p)) { + break; + } + ++i; + } + + if (i == _system.bundles.end()) { + /* it's not already in there, so add it */ + _system.add_port (p); + } } else { if (p.substr(0, client_matching_string.length()) != client_matching_string) { /* other (non-ardour) prefix */ |