13
0

Prefer parameter_is_midi() API, fixes PolyKeyPressure

Previously MidiNotePressureAutomation was not assumed to be
MIDI automation.
This commit is contained in:
Robin Gareus 2020-04-15 15:36:45 +02:00
parent 895b9c2051
commit 21df7279d2
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -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