diff options
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/bundle.h | 1 | ||||
-rw-r--r-- | libs/ardour/bundle.cc | 17 |
2 files changed, 18 insertions, 0 deletions
diff --git a/libs/ardour/ardour/bundle.h b/libs/ardour/ardour/bundle.h index 8b1af39e75..f9971ddf15 100644 --- a/libs/ardour/ardour/bundle.h +++ b/libs/ardour/ardour/bundle.h @@ -90,6 +90,7 @@ class Bundle : public sigc::trackable void remove_port_from_channel (uint32_t, std::string); bool port_attached_to_channel (uint32_t, std::string); bool uses_port (std::string) const; + bool offers_port_alone (std::string) const; void remove_channel (uint32_t); void remove_channels (); diff --git a/libs/ardour/bundle.cc b/libs/ardour/bundle.cc index 70800b06eb..53fc2f1930 100644 --- a/libs/ardour/bundle.cc +++ b/libs/ardour/bundle.cc @@ -173,6 +173,23 @@ Bundle::uses_port (std::string p) const return false; } +/** @param p Port name. + * @return true if this bundle offers this port on its own on a channel. + */ +bool +Bundle::offers_port_alone (std::string p) const +{ + Glib::Mutex::Lock lm (_channel_mutex); + + for (std::vector<Channel>::const_iterator i = _channel.begin(); i != _channel.end(); ++i) { + if (i->ports.size() == 1 && i->ports[0] == p) { + return true; + } + } + + return false; +} + std::string Bundle::channel_name (uint32_t ch) const { |