diff options
author | Robin Gareus <robin@gareus.org> | 2020-04-15 15:36:45 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2020-04-15 15:36:45 +0200 |
commit | 21df7279d24f824c719e489805be45c5694ccea2 (patch) | |
tree | df59366d3d61725bf8650d1842f5449c8c571406 | |
parent | 895b9c20518141510ec0192f603913475fae6493 (diff) |
Prefer parameter_is_midi() API, fixes PolyKeyPressure
Previously MidiNotePressureAutomation was not assumed to be
MIDI automation.
-rw-r--r-- | gtk2_ardour/automation_time_axis.cc | 14 |
1 files changed, 4 insertions, 10 deletions
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<Gtk::CheckMenuItem*>(&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 |