13
0

Fix Bundle Editor: show connected ports

PortGroupList::gather() first adds UserBundle ports to
`system->add_bundle (*i, allow_dups);`

That can include ports that are already associated with the
current bundle. The port in this case has the Bundle's name.
Those ports are later removed in BundleEditorMatrix::setup_ports
`_ports[OTHER].remove_bundle (_bundle);`

However we do need to show physical ports by their name, even
if they're identical to the already associated bundle to allow
disassociating them.
This commit is contained in:
Robin Gareus 2021-02-26 19:14:57 +01:00
parent 4716f34c28
commit 355528781d
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 12 additions and 9 deletions

View File

@ -59,8 +59,8 @@ BundleEditorMatrix::setup_ports (int dim)
_ports[OTHER].suspend_signals ();
/* when we gather, allow the matrix to contain bundles with duplicate port sets,
otherwise in some cases the basic system IO ports may be hidden, making
the bundle editor useless */
* otherwise ports already associated with this bundle will be hidden, making
* the bundle editor useless */
_ports[OTHER].gather (_session, DataType::NIL, _bundle->ports_are_inputs(), true, show_only_bundles ());
_ports[OTHER].remove_bundle (_bundle);

View File

@ -587,12 +587,15 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
std::string const p = *s;
if (!system->has_port(p) &&
!bus->has_port(p) &&
!track->has_port(p) &&
!sidechain->has_port(p) &&
!program->has_port(p) &&
!other->has_port(p)) {
if (allow_dups || (
!system->has_port(p)
&& !bus->has_port(p)
&& !track->has_port(p)
&& !sidechain->has_port(p)
&& !program->has_port(p)
&& !other->has_port(p)
)
) {
/* special hack: ignore MIDI ports labelled Midi-Through. these
are basically useless and mess things up for default
@ -670,7 +673,7 @@ PortGroupList::gather (ARDOUR::Session* session, ARDOUR::DataType type, bool inp
for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
if (!extra_system[*i].empty()) {
boost::shared_ptr<Bundle> b = make_bundle_from_ports (extra_system[*i], *i, inputs);
system->add_bundle (b);
system->add_bundle (b, allow_dups);
}
}