FastLED 3.9.7
Loading...
Searching...
No Matches
midi_Message.h
Go to the documentation of this file.
1
28#pragma once
29
30#include "midi_Namespace.h"
31#include "midi_Defs.h"
32#ifndef ARDUINO
33#include <string.h>
34#endif
35
36BEGIN_MIDI_NAMESPACE
37
41template<unsigned SysExMaxSize>
42struct Message
43{
47 inline Message()
48 : channel(0)
49 , type(MIDI_NAMESPACE::InvalidType)
50 , data1(0)
51 , data2(0)
52 , valid(false)
53 {
54 memset(sysexArray, 0, sSysExMaxSize * sizeof(DataByte));
55 }
56
59 static const unsigned sSysExMaxSize = SysExMaxSize;
60
64 Channel channel;
65
70
74 DataByte data1;
75
80 DataByte data2;
81
87
92 bool valid;
93
96 unsigned length;
97
98 inline unsigned getSysExSize() const
99 {
100 const unsigned size = unsigned(data2) << 8 | data1;
101 return size > sSysExMaxSize ? sSysExMaxSize : size;
102 }
103};
104
105END_MIDI_NAMESPACE
MIDI Library for the Arduino - Definitions.
MidiType
Definition midi_Defs.h:95
@ InvalidType
For notifying errors.
Definition midi_Defs.h:96
MIDI Library for the Arduino - Namespace declaration.
static const unsigned sSysExMaxSize
Channel channel
DataByte sysexArray[sSysExMaxSize]
bool valid
DataByte data1
MidiType type
unsigned length
DataByte data2