summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gtk2_ardour/port_matrix.cc')
-rw-r--r--gtk2_ardour/port_matrix.cc28
1 files changed, 15 insertions, 13 deletions
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc
index fb7bca7946..286111c6d4 100644
--- a/gtk2_ardour/port_matrix.cc
+++ b/gtk2_ardour/port_matrix.cc
@@ -411,19 +411,21 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
boost::weak_ptr<Bundle> w (bc[dim].bundle);
- /* Start off with options for the `natural' port type */
- for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
- if (should_show (*i)) {
- snprintf (buf, sizeof (buf), _("Add %s %s"), (*i).to_i18n_string(), channel_noun().c_str());
- sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
+ if (can_add_channels (bc[dim].bundle)) {
+ /* Start off with options for the `natural' port type */
+ for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
+ if (should_show (*i)) {
+ snprintf (buf, sizeof (buf), _("Add %s %s"), (*i).to_i18n_string(), channel_noun().c_str());
+ sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
+ }
}
- }
-
- /* Now add other ones */
- for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
- if (!should_show (*i)) {
- snprintf (buf, sizeof (buf), _("Add %s %s"), (*i).to_i18n_string(), channel_noun().c_str());
- sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
+
+ /* Now add other ones */
+ for (DataType::iterator i = DataType::begin(); i != DataType::end(); ++i) {
+ if (!should_show (*i)) {
+ snprintf (buf, sizeof (buf), _("Add %s %s"), (*i).to_i18n_string(), channel_noun().c_str());
+ sub.push_back (MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::add_channel_proxy), w, *i)));
+ }
}
}
@@ -677,7 +679,7 @@ PortMatrix::io_from_bundle (boost::shared_ptr<Bundle> b) const
}
bool
-PortMatrix::can_add_channel (boost::shared_ptr<Bundle> b) const
+PortMatrix::can_add_channels (boost::shared_ptr<Bundle> b) const
{
return io_from_bundle (b);
}