summaryrefslogtreecommitdiff
path: root/libs/evoral/evoral/MIDIEvent.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/evoral/evoral/MIDIEvent.hpp')
-rw-r--r--libs/evoral/evoral/MIDIEvent.hpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/libs/evoral/evoral/MIDIEvent.hpp b/libs/evoral/evoral/MIDIEvent.hpp
index 9b1d72c400..f0c9c74589 100644
--- a/libs/evoral/evoral/MIDIEvent.hpp
+++ b/libs/evoral/evoral/MIDIEvent.hpp
@@ -104,6 +104,21 @@ public:
return this->size() == 10 && this->_buf[0] == 0xf0 && this->_buf[1] == 0x7f &&
this->_buf[3] == 0x01 && this->_buf[4] == 0x01;
}
+
+ inline uint16_t value() const {
+ switch (type()) {
+ case MIDI_CMD_CONTROL:
+ return cc_value();
+ case MIDI_CMD_BENDER:
+ return pitch_bender_value();
+ case MIDI_CMD_NOTE_PRESSURE:
+ return aftertouch();
+ case MIDI_CMD_CHANNEL_PRESSURE:
+ return channel_pressure();
+ default:
+ return 0;
+ }
+ }
};
} // namespace Evoral