*/
-#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>
+#include <cstdio>
+#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;
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;
}
&& 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:
case MIDI_CTL_OMNI_ON:
case MIDI_CTL_MONO:
case MIDI_CTL_POLY:
-
- return Evoral::ControlList::Discrete;
- break;
-
- default: return Evoral::ControlList::Linear; break;
+ 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
}
Evoral::MIDI::controller_range(min, max, normal); break;
case MidiPitchBenderAutomation:
Evoral::MIDI::bender_range(min, max, normal); break;
+ case MidiSystemExclusiveAutomation:
+ return p;
}
-
- p.set_range(type, min, max, normal);
+
+ p.set_range(type, min, max, normal, false);
return p;
}
assert(channel < 16);
p_id = 0;
p_channel = channel;
- } else if (str.length() > 24 && str.substr(0, 24) == "midi-channel-pressure-") {
+ } else if (str.length() > 22 && str.substr(0, 22) == "midi-channel-pressure-") {
p_type = MidiChannelPressureAutomation;
uint32_t channel = 0;
sscanf(str.c_str(), "midi-channel-pressure-%d", &channel);