From 84eee94b1e7fea035f1089d52c75c2d51ed5d5ca Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 26 Jan 2013 22:08:06 +0000 Subject: [PATCH] Fix named controls menu to display all controls (don't miss the last submenu). git-svn-id: svn://localhost/ardour2/branches/3.0@14000 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/midi_time_axis.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 2b42d65a73..fc87ed89d0 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -217,7 +217,6 @@ MidiTimeAxisView::set_route (boost::shared_ptr rt) } } - MIDI::Name::MidiPatchManager& patch_manager = MIDI::Name::MidiPatchManager::instance(); MIDI::Name::MasterDeviceNames::Models::const_iterator m = patch_manager.all_models().begin(); @@ -836,10 +835,11 @@ MidiTimeAxisView::build_controller_menu () Menu* ctl_menu = NULL; for (ControlNameList::Controls::const_iterator c = name_list->controls().begin(); - c != name_list->controls().end(); ++c) { + c != name_list->controls().end();) { const uint16_t ctl = c->second->number(); if (ctl == MIDI_CTL_MSB_BANK || ctl == MIDI_CTL_LSB_BANK) { /* Skip bank select controllers since they're handled specially */ + /* FIXME: If this is the last control, the last submenu might be lost */ continue; } @@ -854,7 +854,8 @@ MidiTimeAxisView::build_controller_menu () } else { add_single_channel_controller_item(ctl_items, ctl, c->second->name()); } - + + ++c; if (++n_items == 16 || c == name_list->controls().end()) { /* Submenu has 16 items, add it to controller menu and reset */ items.push_back( @@ -1388,7 +1389,6 @@ MidiTimeAxisView::stop_step_editing () } } - /** @return channel (counted from 0) to add an event to, based on the current setting * of the channel selector. */