Control Surface main
MIDI Control Surface library for Arduino
MIDIReadEvent.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <stdint.h>
4
6#include <Settings/NamespaceSettings.hpp>
7
9
11enum class MIDIReadEvent : uint8_t {
12 NO_MESSAGE = 0,
13 CHANNEL_MESSAGE = 1,
14 SYSEX_MESSAGE = 2,
16 SYSEX_CHUNK = 4,
18};
19
21 switch (evt) {
22 case MIDIReadEvent::NO_MESSAGE: return F("NO_MESSAGE");
23 case MIDIReadEvent::CHANNEL_MESSAGE: return F("CHANNEL_MESSAGE");
24 case MIDIReadEvent::SYSEX_MESSAGE: return F("SYSEX_MESSAGE");
25 case MIDIReadEvent::REALTIME_MESSAGE: return F("REALTIME_MESSAGE");
26 case MIDIReadEvent::SYSEX_CHUNK: return F("SYSEX_CHUNK");
27 case MIDIReadEvent::SYSCOMMON_MESSAGE: return F("SYSCOMMON_MESSAGE");
28 default: return F("<invalid>");
29 }
30}
31
32inline Print &operator<<(Print &p, MIDIReadEvent evt) {
33 return p << enum_to_string(evt);
34}
35
std::remove_reference< decltype(*F(""))>::type * FlashString_t
MIDIReadEvent
Values returned by the MIDI reading functions.
@ CHANNEL_MESSAGE
A MIDI Channel message was received.
@ SYSEX_CHUNK
An incomplete System Exclusive message.
@ SYSCOMMON_MESSAGE
A MIDI System Common message was received.
@ NO_MESSAGE
No new messages were received.
@ SYSEX_MESSAGE
A MIDI System Exclusive message was received.
@ REALTIME_MESSAGE
A MIDI Real-Time message was received.
FlashString_t enum_to_string(MIDIReadEvent evt)
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Print & operator<<(Print &os, Quaternion e)
Printing.
Definition: Quaternion.cpp:28