summaryrefslogtreecommitdiff
path: root/gtk2_ardour/port_matrix.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2011-11-02 00:10:27 +0000
committerCarl Hetherington <carl@carlh.net>2011-11-02 00:10:27 +0000
commit4cab367b3152c4924a690926e3ad4f39139f3688 (patch)
tree64d0e41983cee107dc395a5024613dd28807e898 /gtk2_ardour/port_matrix.cc
parent337e010345fa98f7b5425ef5cbf31e0ed582c678 (diff)
Re-allow adding ports to empty bundles (#4408), and fix disassociation (disconnection) menu options as well.
git-svn-id: svn://localhost/ardour2/branches/3.0@10388 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix.cc')
-rw-r--r--gtk2_ardour/port_matrix.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc
index 7125780ccf..576b8789ca 100644
--- a/gtk2_ardour/port_matrix.cc
+++ b/gtk2_ardour/port_matrix.cc
@@ -387,13 +387,6 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
{
using namespace Menu_Helpers;
- if ((row.bundle && row.bundle->nchannels().n_total() == 0) || (column.bundle && column.bundle->nchannels().n_total() == 0)) {
- /* One of the bundles has no channels, which means that it has none of the appropriate type,
- and is only being displayed to look pretty. So we don't need to do anything.
- */
- return;
- }
-
delete _menu;
_menu = new Menu;
@@ -468,16 +461,23 @@ PortMatrix::popup_menu (BundleChannel column, BundleChannel row, uint32_t t)
uint32_t c = count_of_our_type (bc[dim].bundle->nchannels ());
if ((_show_only_bundles && c > 0) || c == 1) {
+
+ /* we're looking just at bundles, or our bundle has only one channel, so just offer
+ to disassociate all on the bundle.
+ */
+
snprintf (buf, sizeof (buf), _("%s all"), disassociation_verb().c_str());
sub.push_back (
- MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::disassociate_all_on_channel), w, bc[dim].channel, dim))
+ MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::disassociate_all_on_bundle), w, dim))
);
-
- } else {
+
+ } else if (c != 0) {
if (bc[dim].channel != -1) {
+ /* specific channel under the menu, so just offer to disassociate that */
add_disassociate_option (sub, w, dim, bc[dim].channel);
- } else if (count_of_our_type (bc[dim].bundle->nchannels()) != 0) {
+ } else {
+ /* no specific channel; offer to disassociate all, or any one in particular */
snprintf (buf, sizeof (buf), _("%s all"), disassociation_verb().c_str());
sub.push_back (
MenuElem (buf, sigc::bind (sigc::mem_fun (*this, &PortMatrix::disassociate_all_on_bundle), w, dim))
@@ -562,7 +562,7 @@ PortMatrix::disassociate_all_on_channel (boost::weak_ptr<Bundle> bundle, uint32_
for (PortGroup::BundleList::iterator i = a.begin(); i != a.end(); ++i) {
for (uint32_t j = 0; j < (*i)->bundle->nchannels().n_total(); ++j) {
- if (should_show ((*i)->bundle->channel_type(j))) {
+ if (!should_show ((*i)->bundle->channel_type(j))) {
continue;
}