- if (b != 3) {
- return;
- }
-
- if ( (_location == LEFT && x > (_longest_bundle_name + name_pad() * 2)) ||
- (_location == RIGHT && x < (_longest_port_name + name_pad() * 2))
- ) {
-
- delete _menu;
-
- _menu = new Gtk::Menu;
- _menu->set_name ("ArdourContextMenu");
-
- Gtk::Menu_Helpers::MenuList& items = _menu->items ();
-
- uint32_t row = y / row_height ();
-
- boost::shared_ptr<ARDOUR::Bundle> bundle;
- uint32_t channel = 0;
-
- ARDOUR::BundleList const r = _body->row_ports().bundles();
- for (ARDOUR::BundleList::const_iterator i = r.begin(); i != r.end(); ++i) {
- if (row < (*i)->nchannels ()) {
- bundle = *i;
- channel = row;
- break;
- } else {
- row -= (*i)->nchannels ();
- }
- }
-
- if (bundle) {
- char buf [64];
-
- if (_port_matrix->can_rename_channels ()) {
- snprintf (buf, sizeof (buf), _("Rename '%s'..."), bundle->channel_name (channel).c_str());
- items.push_back (
- Gtk::Menu_Helpers::MenuElem (
- buf,
- sigc::bind (sigc::mem_fun (*this, &PortMatrixRowLabels::rename_channel_proxy), bundle, channel)
- )
- );
- }
-
- snprintf (buf, sizeof (buf), _("Remove '%s'"), bundle->channel_name (channel).c_str());
- items.push_back (
- Gtk::Menu_Helpers::MenuElem (
- buf,
- sigc::bind (sigc::mem_fun (*this, &PortMatrixRowLabels::remove_channel_proxy), bundle, channel)
- )
- );
-
- _menu->popup (1, t);
- }
- }
-}