From 3705a2d6307cf443acbf8419b0e0f560591f2016 Mon Sep 17 00:00:00 2001 From: Hans Baier Date: Wed, 28 Jan 2009 04:55:31 +0000 Subject: * MIDI control lanes: Set Interpolationtype according to Parameter git-svn-id: svn://localhost/ardour2/branches/3.0@4452 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/event_type_map.cc | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'libs/ardour/event_type_map.cc') diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc index a4d8317a42..3b4fefdcea 100644 --- a/libs/ardour/event_type_map.cc +++ b/libs/ardour/event_type_map.cc @@ -75,6 +75,63 @@ EventTypeMap::is_integer(const Evoral::Parameter& param) const && param.type() <= MidiChannelPressureAutomation); } +Evoral::ControlList::InterpolationStyle +EventTypeMap::interpolation_of(const Evoral::Parameter& param) +{ + switch (param.type()) { + case MidiCCAutomation: + switch (param.id()) { + case MIDI_CTL_LSB_BANK: + case MIDI_CTL_MSB_BANK: + case MIDI_CTL_LSB_EFFECT1: + case MIDI_CTL_LSB_EFFECT2: + case MIDI_CTL_MSB_EFFECT1: + case MIDI_CTL_MSB_EFFECT2: + case MIDI_CTL_MSB_GENERAL_PURPOSE1: + case MIDI_CTL_MSB_GENERAL_PURPOSE2: + case MIDI_CTL_MSB_GENERAL_PURPOSE3: + case MIDI_CTL_MSB_GENERAL_PURPOSE4: + case MIDI_CTL_SUSTAIN: + case MIDI_CTL_PORTAMENTO: + case MIDI_CTL_SOSTENUTO: + case MIDI_CTL_SOFT_PEDAL: + case MIDI_CTL_LEGATO_FOOTSWITCH: + case MIDI_CTL_HOLD2: + case MIDI_CTL_GENERAL_PURPOSE5: + case MIDI_CTL_GENERAL_PURPOSE6: + case MIDI_CTL_GENERAL_PURPOSE7: + case MIDI_CTL_GENERAL_PURPOSE8: + case MIDI_CTL_DATA_INCREMENT: + case MIDI_CTL_DATA_DECREMENT: + case MIDI_CTL_NONREG_PARM_NUM_LSB: + case MIDI_CTL_NONREG_PARM_NUM_MSB: + case MIDI_CTL_REGIST_PARM_NUM_LSB: + case MIDI_CTL_REGIST_PARM_NUM_MSB: + case MIDI_CTL_ALL_SOUNDS_OFF: + case MIDI_CTL_RESET_CONTROLLERS: + case MIDI_CTL_LOCAL_CONTROL_SWITCH: + case MIDI_CTL_ALL_NOTES_OFF: + case MIDI_CTL_OMNI_OFF: + case MIDI_CTL_OMNI_ON: + case MIDI_CTL_MONO: + case MIDI_CTL_POLY: + + return Evoral::ControlList::Discrete; + break; + + default: return Evoral::ControlList::Linear; break; + } + + break; + + case MidiPgmChangeAutomation: return Evoral::ControlList::Discrete; break; + case MidiChannelPressureAutomation: return Evoral::ControlList::Linear; break; + case MidiPitchBenderAutomation: return Evoral::ControlList::Linear; break; + default: assert(false); + } +} + + Evoral::Parameter EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const { -- cgit v1.2.3