UserBundle: Allow adding/removing ports

Clean up internal API confusion
- can_add_channels_proxy () -- checks presence of io
- can_add_channel_proxy () -- checks io->can_add_port()

UserBundle don't have a PortGroup::_bundle reference
that can be used to lookup the IO via io_from_bundle().

While BundleEditorMatrix::can_add_channels_proxy() was overriden
to allow adding I/Os, can_add_channel_proxy() later prevented that.

This further prevents removing the last port, preventing empty bundles.
This commit is contained in:
Robin Gareus 2021-02-26 14:06:04 +01:00
parent 017b272864
commit 4716f34c28
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
4 changed files with 28 additions and 10 deletions

View file

@ -44,6 +44,7 @@ public:
PortMatrixNode::State get_state (ARDOUR::BundleChannel c[2]) const;
bool can_add_channels (boost::shared_ptr<ARDOUR::Bundle>) const;
bool can_add_port (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::DataType t) const;
void add_channel (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::DataType);
bool can_remove_channels (boost::shared_ptr<ARDOUR::Bundle>) const;