diff --git a/gtk2_ardour/automation_time_axis.cc b/gtk2_ardour/automation_time_axis.cc index ac524ab5e6..d3623cbb6f 100644 --- a/gtk2_ardour/automation_time_axis.cc +++ b/gtk2_ardour/automation_time_axis.cc @@ -178,8 +178,7 @@ AutomationTimeAxisView::AutomationTimeAxisView ( auto_dropdown.AddMenuElem (MenuElem (_("Play"), sigc::bind (sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state), (AutoState) Play))); - if (!(_parameter.type() >= MidiCCAutomation && - _parameter.type() <= MidiChannelPressureAutomation)) { + if (!parameter_is_midi(_parameter.type ())) { auto_dropdown.AddMenuElem (MenuElem (_("Write"), sigc::bind (sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state), (AutoState) Write))); auto_dropdown.AddMenuElem (MenuElem (_("Touch"), sigc::bind (sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state), (AutoState) Touch))); auto_dropdown.AddMenuElem (MenuElem (_("Latch"), sigc::bind (sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state), (AutoState) Latch))); @@ -619,7 +618,7 @@ AutomationTimeAxisView::hide_clicked () string AutomationTimeAxisView::automation_state_off_string () const { - if (_parameter.type() >= MidiCCAutomation && _parameter.type() <= MidiChannelPressureAutomation) { + if (parameter_is_midi(_parameter.type ())) { return S_("Automation|Off"); } @@ -660,8 +659,7 @@ AutomationTimeAxisView::build_display_menu () (AutoState) Play))); auto_play_item = dynamic_cast(&as_items.back()); - if (!(_parameter.type() >= MidiCCAutomation && - _parameter.type() <= MidiChannelPressureAutomation)) { + if (!parameter_is_midi(_parameter.type ())) { as_items.push_back (CheckMenuElem (_("Write"), sigc::bind ( sigc::mem_fun(*this, &AutomationTimeAxisView::set_automation_state), (AutoState) Write))); @@ -970,11 +968,7 @@ AutomationTimeAxisView::propagate_time_selection () const /* MIDI automation is part of the MIDI region. It is always * implicily selected with the parent, regardless of TAV selection */ - if (_parameter.type() >= MidiCCAutomation && - _parameter.type() <= MidiChannelPressureAutomation) { - return true; - } - return false; + return parameter_is_midi(_parameter.type ()); } void