@@ -30,6 +30,13 @@ BEGIN_APPLEMIDI_NAMESPACE
30
30
31
31
static unsigned long now;
32
32
33
+ struct AppleMIDISettings : public MIDI_NAMESPACE ::DefaultSettings
34
+ {
35
+ // Packet based protocols prefer the entire message to be parsed
36
+ // as a whole.
37
+ static const bool Use1ByteParsing = false ;
38
+ };
39
+
33
40
template <class UdpClass , class _Settings = DefaultSettings, class _Platform = ArduinoPlatform>
34
41
class AppleMIDISession
35
42
{
@@ -40,7 +47,7 @@ class AppleMIDISession
40
47
// to avoid access by the .ino to internal messages
41
48
friend class AppleMIDIParser <UdpClass, Settings, Platform>;
42
49
friend class rtpMIDIParser <UdpClass, Settings, Platform>;
43
- friend class MIDI_NAMESPACE ::MidiInterface<AppleMIDISession<UdpClass>>;
50
+ friend class MIDI_NAMESPACE ::MidiInterface<AppleMIDISession<UdpClass>, AppleMIDISettings >;
44
51
45
52
public:
46
53
AppleMIDISession (const char *name, const uint16_t port = DEFAULT_CONTROL_PORT)
@@ -66,7 +73,7 @@ class AppleMIDISession
66
73
void sendEndSession ();
67
74
68
75
protected:
69
- static const bool thruActivated = false ;
76
+ static const bool thruActivated = false ;
70
77
71
78
void begin ()
72
79
{
@@ -280,17 +287,16 @@ class AppleMIDISession
280
287
Participant<Settings>* getParticipantByInitiatorToken (const uint32_t initiatorToken);
281
288
};
282
289
290
+ END_APPLEMIDI_NAMESPACE
291
+
292
+ #include " AppleMIDI.hpp"
293
+
283
294
#define APPLEMIDI_CREATE_INSTANCE (Type, Name, SessionName, Port ) \
284
295
APPLEMIDI_NAMESPACE::AppleMIDISession<Type> Apple##Name(SessionName, Port); \
285
- MIDI_NAMESPACE::MidiInterface<APPLEMIDI_NAMESPACE::AppleMIDISession<Type>> Name ((APPLEMIDI_NAMESPACE::AppleMIDISession<Type>&)Apple##Name);
296
+ MIDI_NAMESPACE::MidiInterface<APPLEMIDI_NAMESPACE::AppleMIDISession<Type>, AppleMIDISettings > Name ((APPLEMIDI_NAMESPACE::AppleMIDISession<Type>&)Apple##Name);
286
297
287
298
#define APPLEMIDI_CREATE_DEFAULTSESSION_INSTANCE () \
288
299
APPLEMIDI_CREATE_INSTANCE (EthernetUDP, MIDI, " Arduino" , DEFAULT_CONTROL_PORT);
289
300
290
301
#define APPLEMIDI_CREATE_DEFAULTSESSION_ESP32_INSTANCE () \
291
302
APPLEMIDI_CREATE_INSTANCE (WiFiUDP, MIDI, " ESP32" , DEFAULT_CONTROL_PORT);
292
-
293
- END_APPLEMIDI_NAMESPACE
294
-
295
- #include " AppleMIDI.hpp"
296
-
0 commit comments