fix midnam-related crash introduced around 13892
git-svn-id: svn://localhost/ardour2/branches/3.0@13897 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
051b81494c
commit
c779251a3e
|
@ -782,9 +782,12 @@ MidiTimeAxisView::build_controller_menu ()
|
||||||
const Glib::ustring model = _midnam_model_selector.get_active_text();
|
const Glib::ustring model = _midnam_model_selector.get_active_text();
|
||||||
boost::shared_ptr<MIDINameDocument> midnam = MidiPatchManager::instance()
|
boost::shared_ptr<MIDINameDocument> midnam = MidiPatchManager::instance()
|
||||||
.document_by_model(model);
|
.document_by_model(model);
|
||||||
boost::shared_ptr<MasterDeviceNames> device_names = midnam->master_device_names(
|
boost::shared_ptr<MasterDeviceNames> device_names;
|
||||||
model);
|
|
||||||
|
|
||||||
|
if (midnam) {
|
||||||
|
device_names = midnam->master_device_names(model);
|
||||||
|
}
|
||||||
|
|
||||||
if (device_names && !device_names->controls().empty()) {
|
if (device_names && !device_names->controls().empty()) {
|
||||||
/* Controllers names available in midnam file, generate fancy menu */
|
/* Controllers names available in midnam file, generate fancy menu */
|
||||||
unsigned n_items = 0;
|
unsigned n_items = 0;
|
||||||
|
@ -793,7 +796,7 @@ MidiTimeAxisView::build_controller_menu ()
|
||||||
l != device_names->controls().end(); ++l) {
|
l != device_names->controls().end(); ++l) {
|
||||||
boost::shared_ptr<ControlNameList> name_list = *l;
|
boost::shared_ptr<ControlNameList> name_list = *l;
|
||||||
Menu* ctl_menu = NULL;
|
Menu* ctl_menu = NULL;
|
||||||
|
|
||||||
for (ControlNameList::Controls::const_iterator c = (*l)->controls().begin();
|
for (ControlNameList::Controls::const_iterator c = (*l)->controls().begin();
|
||||||
c != (*l)->controls().end(); ++c) {
|
c != (*l)->controls().end(); ++c) {
|
||||||
const int ctl = atoi((*c)->number().c_str());
|
const int ctl = atoi((*c)->number().c_str());
|
||||||
|
@ -801,12 +804,12 @@ MidiTimeAxisView::build_controller_menu ()
|
||||||
/* Skip bank select controllers since they're handled specially */
|
/* Skip bank select controllers since they're handled specially */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (n_items == 0) {
|
if (n_items == 0) {
|
||||||
/* Create a new submenu */
|
/* Create a new submenu */
|
||||||
ctl_menu = manage (new Menu);
|
ctl_menu = manage (new Menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuList& ctl_items (ctl_menu->items());
|
MenuList& ctl_items (ctl_menu->items());
|
||||||
if (chn_cnt > 1) {
|
if (chn_cnt > 1) {
|
||||||
add_multi_channel_controller_item(ctl_items, ctl, (*c)->name());
|
add_multi_channel_controller_item(ctl_items, ctl, (*c)->name());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user