@@ -30,7 +30,6 @@ template<class SerialPort, class Settings>
3030inline MidiInterface<SerialPort, Settings>::MidiInterface(SerialPort& inSerial)
3131 : mSerial (inSerial)
3232{
33- #if MIDI_BUILD_INPUT && MIDI_USE_CALLBACKS
3433 mNoteOffCallback = 0 ;
3534 mNoteOnCallback = 0 ;
3635 mAfterTouchPolyCallback = 0 ;
@@ -49,7 +48,6 @@ inline MidiInterface<SerialPort, Settings>::MidiInterface(SerialPort& inSerial)
4948 mStopCallback = 0 ;
5049 mActiveSensingCallback = 0 ;
5150 mSystemResetCallback = 0 ;
52- #endif
5351}
5452
5553/* ! \brief Destructor for MidiInterface.
@@ -476,7 +474,7 @@ inline bool MidiInterface<SerialPort, Settings>::read(Channel inChannel)
476474 handleNullVelocityNoteOnAsNoteOff ();
477475 const bool channelMatch = inputFilter (inChannel);
478476
479- if (MIDI_USE_CALLBACKS && channelMatch)
477+ if (channelMatch)
480478 {
481479 launchCallback ();
482480 }
@@ -616,15 +614,17 @@ bool MidiInterface<SerialPort, Settings>::parse()
616614 mPendingMessageIndex ++;
617615 }
618616
619- #if USE_1BYTE_PARSING
620- // Message is not complete.
621- return false ;
622- #else
623- // Call the parser recursively
624- // to parse the rest of the message.
625- return parse ();
626- #endif
627-
617+ if (Settings::Use1ByteParsing)
618+ {
619+ // Message is not complete.
620+ return false ;
621+ }
622+ else
623+ {
624+ // Call the parser recursively
625+ // to parse the rest of the message.
626+ return parse ();
627+ }
628628 }
629629 else
630630 {
0 commit comments