mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
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:
parent
017b272864
commit
4716f34c28
4 changed files with 28 additions and 10 deletions
|
|
@ -112,6 +112,17 @@ BundleEditorMatrix::can_add_channels (boost::shared_ptr<Bundle> b) const
|
|||
return PortMatrix::can_add_channels (b);
|
||||
}
|
||||
|
||||
bool
|
||||
BundleEditorMatrix::can_add_port (boost::shared_ptr<Bundle> b, DataType t) const
|
||||
{
|
||||
#if 1
|
||||
return true; // anything goes
|
||||
#else
|
||||
/* Do not allow to mix datatypes */
|
||||
return _bundle->nchannels().get (t) > 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
BundleEditorMatrix::add_channel (boost::shared_ptr<Bundle> b, DataType t)
|
||||
{
|
||||
|
|
@ -136,11 +147,10 @@ BundleEditorMatrix::add_channel (boost::shared_ptr<Bundle> b, DataType t)
|
|||
bool
|
||||
BundleEditorMatrix::can_remove_channels (boost::shared_ptr<Bundle> b) const
|
||||
{
|
||||
if (b == _bundle) {
|
||||
return true;
|
||||
if (b != _bundle) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return PortMatrix::can_remove_channels (b);
|
||||
return _bundle->n_total () > 1;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue