diff options
author | Carl Hetherington <carl@carlh.net> | 2009-07-19 20:12:59 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-07-19 20:12:59 +0000 |
commit | c6509b8f86c29f05e64e98093fda7635ac951ebb (patch) | |
tree | b311dfa688b81150185a1500fca4732f2468d125 /gtk2_ardour/port_matrix.cc | |
parent | 6da5dd6d41df9e3d05b9b8cceaf1b671b4e21141 (diff) |
Restore add channel option to port matrix context menu.
git-svn-id: svn://localhost/ardour2/branches/3.0@5383 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/port_matrix.cc')
-rw-r--r-- | gtk2_ardour/port_matrix.cc | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/gtk2_ardour/port_matrix.cc b/gtk2_ardour/port_matrix.cc index 001d06081f..c535ef6769 100644 --- a/gtk2_ardour/port_matrix.cc +++ b/gtk2_ardour/port_matrix.cc @@ -264,6 +264,12 @@ PortMatrix::popup_menu ( char buf [64]; + std::string const n = add_channel_name (); + if (!n.empty()) { + snprintf (buf, sizeof (buf), _("Add channel to '%s'"), n.c_str()); + items.push_back (MenuElem (buf, mem_fun (*this, &PortMatrix::add_channel))); + } + for (int dim = 0; dim < 2; ++dim) { if (pg[dim]) { @@ -289,36 +295,28 @@ PortMatrix::popup_menu ( } if (bc[dim].bundle) { - bool have_one = false; - - if (can_rename_channels (dim)) { - snprintf (buf, sizeof (buf), _("Rename '%s'..."), bc[dim].bundle->channel_name (bc[dim].channel).c_str()); - boost::weak_ptr<ARDOUR::Bundle> w (bc[dim].bundle); + boost::weak_ptr<ARDOUR::Bundle> w (bc[dim].bundle); + + if (can_remove_channels (dim)) { + snprintf (buf, sizeof (buf), _("Remove '%s'"), bc[dim].bundle->channel_name (bc[dim].channel).c_str()); items.push_back ( MenuElem ( buf, - bind (mem_fun (*this, &PortMatrix::rename_channel_proxy), w, bc[dim].channel) + bind (mem_fun (*this, &PortMatrix::remove_channel_proxy), w, bc[dim].channel) ) ); - - have_one = true; - } + } - if (can_remove_channels (dim)) { - snprintf (buf, sizeof (buf), _("Remove '%s'"), bc[dim].bundle->channel_name (bc[dim].channel).c_str()); - boost::weak_ptr<ARDOUR::Bundle> w (bc[dim].bundle); + if (can_rename_channels (dim)) { + snprintf (buf, sizeof (buf), _("Rename '%s'..."), bc[dim].bundle->channel_name (bc[dim].channel).c_str()); items.push_back ( MenuElem ( buf, - bind (mem_fun (*this, &PortMatrix::remove_channel_proxy), w, bc[dim].channel) + bind (mem_fun (*this, &PortMatrix::rename_channel_proxy), w, bc[dim].channel) ) ); - - have_one = true; } - boost::weak_ptr<ARDOUR::Bundle> w (bc[dim].bundle); - if (_show_only_bundles) { snprintf (buf, sizeof (buf), _("%s all from '%s'"), disassociation_verb().c_str(), bc[dim].bundle->name().c_str()); } else { @@ -349,7 +347,6 @@ PortMatrix::popup_menu ( _menu->popup (1, t); } - void PortMatrix::remove_channel_proxy (boost::weak_ptr<ARDOUR::Bundle> b, uint32_t c) { |