13
0

Don't prevent user from choosing Linear interpolation for controllers if they want to (just set default).

git-svn-id: svn://localhost/ardour2/branches/3.0@5933 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2009-10-26 22:07:23 +00:00
parent 93fccfca30
commit b6e90314b0
2 changed files with 12 additions and 11 deletions

View File

@ -535,7 +535,7 @@ AutomationTimeAxisView::build_display_menu ()
/* mode menu */
if ( EventTypeMap::instance().is_midi_parameter(_control->parameter()) ) {
if (EventTypeMap::instance().is_midi_parameter(_control->parameter())) {
Menu* auto_mode_menu = manage (new Menu);
auto_mode_menu->set_name ("ArdourContextMenu");
@ -544,17 +544,18 @@ AutomationTimeAxisView::build_display_menu ()
RadioMenuItem::Group group;
am_items.push_back (RadioMenuElem (group, _("Discrete"), bind (
mem_fun(*this, &AutomationTimeAxisView::set_interpolation),
AutomationList::Discrete)));
mem_fun(*this, &AutomationTimeAxisView::set_interpolation),
AutomationList::Discrete)));
mode_discrete_item = dynamic_cast<CheckMenuItem*>(&am_items.back());
mode_discrete_item->set_active(_control->list()->interpolation() == AutomationList::Discrete);
// For discrete types we dont allow the linear option since it makes no sense for those Controls
am_items.push_back (RadioMenuElem (group, _("Linear"), bind (
mem_fun(*this, &AutomationTimeAxisView::set_interpolation),
AutomationList::Linear)));
mode_line_item = dynamic_cast<CheckMenuItem*>(&am_items.back());
// Set default interpolation type to linear if this isn't a (usually) discrete controller
if (EventTypeMap::instance().interpolation_of(_control->parameter()) == Evoral::ControlList::Linear) {
am_items.push_back (RadioMenuElem (group, _("Line"), bind (
mem_fun(*this, &AutomationTimeAxisView::set_interpolation),
AutomationList::Linear)));
mode_line_item = dynamic_cast<CheckMenuItem*>(&am_items.back());
mode_line_item->set_active(_control->list()->interpolation() == AutomationList::Linear);
}

View File

@ -118,9 +118,9 @@ EventTypeMap::interpolation_of(const Evoral::Parameter& param)
case MIDI_CTL_OMNI_ON:
case MIDI_CTL_MONO:
case MIDI_CTL_POLY:
return Evoral::ControlList::Discrete;
break;
default: return Evoral::ControlList::Linear; break;
return Evoral::ControlList::Discrete; break;
default:
return Evoral::ControlList::Linear; break;
}
break;
case MidiPgmChangeAutomation: return Evoral::ControlList::Discrete; break;