X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fardour%2Fevent_type_map.cc;h=0388a934f20bd9fa92ebd5af2e0ee1257040db17;hb=0cd3bd4f194439a047f8ab6b7baaf38d118a1d85;hp=063090cef9ea4c195fa56ab6abf35e419e0f2ca2;hpb=de2681f7cddc95e5a859c40e24d302631336a35a;p=ardour.git diff --git a/libs/ardour/event_type_map.cc b/libs/ardour/event_type_map.cc index 063090cef9..0388a934f2 100644 --- a/libs/ardour/event_type_map.cc +++ b/libs/ardour/event_type_map.cc @@ -18,13 +18,14 @@ */ -#include -#include -#include -#include -#include -#include -#include +#include +#include "ardour/types.h" +#include "ardour/event_type_map.h" +#include "evoral/Parameter.hpp" +#include "evoral/midi_events.h" +#include "evoral/MIDIParameters.hpp" +#include "pbd/error.h" +#include "pbd/compose.h" using namespace std; @@ -48,10 +49,10 @@ uint8_t EventTypeMap::parameter_midi_type(const Evoral::Parameter& param) const { switch (param.type()) { - case MidiCCAutomation: return MIDI_CMD_CONTROL; break; - case MidiPgmChangeAutomation: return MIDI_CMD_PGM_CHANGE; break; - case MidiChannelPressureAutomation: return MIDI_CMD_CHANNEL_PRESSURE; break; - case MidiPitchBenderAutomation: return MIDI_CMD_BENDER; break; + case MidiCCAutomation: return MIDI_CMD_CONTROL; break; + case MidiPgmChangeAutomation: return MIDI_CMD_PGM_CHANGE; break; + case MidiChannelPressureAutomation: return MIDI_CMD_CHANNEL_PRESSURE; break; + case MidiPitchBenderAutomation: return MIDI_CMD_BENDER; break; case MidiSystemExclusiveAutomation: return MIDI_CMD_COMMON_SYSEX; break; default: return 0; } @@ -77,11 +78,11 @@ EventTypeMap::is_integer(const Evoral::Parameter& param) const && param.type() <= MidiChannelPressureAutomation); } -Evoral::ControlList::InterpolationStyle +Evoral::ControlList::InterpolationStyle EventTypeMap::interpolation_of(const Evoral::Parameter& param) { switch (param.type()) { - case MidiCCAutomation: + case MidiCCAutomation: switch (param.id()) { case MIDI_CTL_LSB_BANK: case MIDI_CTL_MSB_BANK: @@ -116,17 +117,18 @@ EventTypeMap::interpolation_of(const Evoral::Parameter& param) 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; + 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; + 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); } + return Evoral::ControlList::Linear; // Not reached, suppress warnings } @@ -165,7 +167,7 @@ EventTypeMap::new_parameter(uint32_t type, uint8_t channel, uint32_t id) const case MidiSystemExclusiveAutomation: return p; } - + p.set_range(type, min, max, normal); return p; }