summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-11-07 05:14:55 -0500
committerDavid Robillard <d@drobilla.net>2016-12-03 15:28:19 -0500
commit398a318934769dae51efe972f7ffdefc52ea2963 (patch)
tree5b68a8fac44f0c154e7e00fd45d9e7f2c16e35fb /libs/ardour/ardour
parentbfbc4566ad82573a57e1ec84d583f308ee35eef0 (diff)
Fix event type and parameter type confusion
I'm not sure if this is really the best way to do event types (should it just be a completely static enum in evoral, or completely dynamic and provided by the type map, or a mix like currently?), but previously the event type was frequently set to either total garbage, or parameter types, which are a different thing. This fixes all those cases, and makes Evoral::EventType an enum so the compiler will warn about implicit conversions from int.
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/event_type_map.h4
-rw-r--r--libs/ardour/ardour/midi_buffer.h7
2 files changed, 6 insertions, 5 deletions
diff --git a/libs/ardour/ardour/event_type_map.h b/libs/ardour/ardour/event_type_map.h
index d7adfa8f62..b3aa05ee78 100644
--- a/libs/ardour/ardour/event_type_map.h
+++ b/libs/ardour/ardour/event_type_map.h
@@ -43,7 +43,9 @@ public:
bool type_is_midi(uint32_t type) const;
uint8_t parameter_midi_type(const Evoral::Parameter& param) const;
- uint32_t midi_event_type(uint8_t status) const;
+
+ Evoral::ParameterType midi_parameter_type(const uint8_t* buf, uint32_t len) const;
+
Evoral::ControlList::InterpolationStyle interpolation_of(const Evoral::Parameter& param);
Evoral::Parameter from_symbol(const std::string& str) const;
diff --git a/libs/ardour/ardour/midi_buffer.h b/libs/ardour/ardour/midi_buffer.h
index 1b0bf2a151..cc48e28d61 100644
--- a/libs/ardour/ardour/midi_buffer.h
+++ b/libs/ardour/ardour/midi_buffer.h
@@ -20,8 +20,9 @@
#ifndef __ardour_midi_buffer_h__
#define __ardour_midi_buffer_h__
-#include "evoral/midi_util.h"
#include "evoral/EventSink.hpp"
+#include "evoral/midi_util.h"
+#include "evoral/types.hpp"
#include "midi++/event.h"
@@ -93,7 +94,7 @@ public:
uint8_t* ev_start = buffer->_data + offset + sizeof(TimeType);
int event_size = Evoral::midi_event_size(ev_start);
assert(event_size >= 0);
- return EventType(midi_parameter_type(*ev_start),
+ return EventType(Evoral::MIDI_EVENT,
*(reinterpret_cast<TimeType*>((uintptr_t)(buffer->_data + offset))),
event_size, ev_start);
}
@@ -166,8 +167,6 @@ public:
return iterator (*this, i.offset);
}
- uint8_t* data() const { return _data; }
-
/**
* returns true if the message with the second argument as its MIDI
* status byte should preceed the message with the first argument as