@@ -30,6 +30,13 @@ BEGIN_APPLEMIDI_NAMESPACE
3030
3131static unsigned long now;
3232
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+
3340template <class UdpClass , class _Settings = DefaultSettings, class _Platform = ArduinoPlatform>
3441class AppleMIDISession
3542{
@@ -40,7 +47,7 @@ class AppleMIDISession
4047 // to avoid access by the .ino to internal messages
4148 friend class AppleMIDIParser <UdpClass, Settings, Platform>;
4249 friend class rtpMIDIParser <UdpClass, Settings, Platform>;
43- friend class MIDI_NAMESPACE ::MidiInterface<AppleMIDISession<UdpClass>>;
50+ friend class MIDI_NAMESPACE ::MidiInterface<AppleMIDISession<UdpClass>, AppleMIDISettings >;
4451
4552public:
4653 AppleMIDISession (const char *name, const uint16_t port = DEFAULT_CONTROL_PORT)
@@ -66,7 +73,7 @@ class AppleMIDISession
6673 void sendEndSession ();
6774
6875protected:
69- static const bool thruActivated = false ;
76+ static const bool thruActivated = false ;
7077
7178 void begin ()
7279 {
@@ -280,17 +287,16 @@ class AppleMIDISession
280287 Participant<Settings>* getParticipantByInitiatorToken (const uint32_t initiatorToken);
281288};
282289
290+ END_APPLEMIDI_NAMESPACE
291+
292+ #include " AppleMIDI.hpp"
293+
283294#define APPLEMIDI_CREATE_INSTANCE (Type, Name, SessionName, Port ) \
284295 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);
286297
287298#define APPLEMIDI_CREATE_DEFAULTSESSION_INSTANCE () \
288299APPLEMIDI_CREATE_INSTANCE (EthernetUDP, MIDI, " Arduino" , DEFAULT_CONTROL_PORT);
289300
290301#define APPLEMIDI_CREATE_DEFAULTSESSION_ESP32_INSTANCE () \
291302APPLEMIDI_CREATE_INSTANCE (WiFiUDP, MIDI, " ESP32" , DEFAULT_CONTROL_PORT);
292-
293- END_APPLEMIDI_NAMESPACE
294-
295- #include " AppleMIDI.hpp"
296-
0 commit comments