FastLED 3.9.15
Loading...
Searching...
No Matches

◆ read() [2/2]

template<class Transport, class Settings, class Platform>
bool MidiInterface< Transport, Settings, Platform >::read ( Channel inChannel)
inline

Read messages on a specified channel.

Definition at line 712 of file MIDI.hpp.

713{
714 #ifndef RegionActiveSending
715 // Active Sensing. This message is intended to be sent
716 // repeatedly to tell the receiver that a connection is alive. Use
717 // of this message is optional. When initially received, the
718 // receiver will expect to receive another Active Sensing
719 // message each 300ms (max), and if it does not then it will
720 // assume that the connection has been terminated. At
721 // termination, the receiver will turn off all voices and return to
722 // normal (non- active sensing) operation.
724 {
727 }
728
730 {
732
733 mLastError |= 1UL << ErrorActiveSensingTimeout; // set the ErrorActiveSensingTimeout bit
734 if (mErrorCallback)
736 }
737 #endif
738
740 return false; // MIDI Input disabled.
741
742 if (!parse())
743 return false;
744
745 #ifndef RegionActiveSending
746
748 {
749 // When an ActiveSensing message is received, the time keeping is activated.
750 // When a timeout occurs, an error message is send and time keeping ends.
752
753 // is ErrorActiveSensingTimeout bit in mLastError on
754 if (mLastError & (1 << (ErrorActiveSensingTimeout - 1)))
755 {
756 mLastError &= ~(1UL << ErrorActiveSensingTimeout); // clear the ErrorActiveSensingTimeout bit
757 if (mErrorCallback)
759 }
760 }
761
762 // Keep the time of the last received message, so we can check for the timeout
765
766 #endif
767
769
770 const bool channelMatch = inputFilter(inChannel);
771 if (channelMatch)
773
775
776 return channelMatch;
777}
unsigned long mLastMessageReceivedTime
Definition MIDI.h:285
void launchCallback()
Definition MIDI.hpp:1294
ErrorCallback mErrorCallback
Definition MIDI.h:215
int8_t mLastError
Definition MIDI.h:288
bool mReceiverActiveSensingActivated
Definition MIDI.h:287
void thruFilter(byte inChannel)
Definition MIDI.hpp:1400
unsigned long mLastMessageSentTime
Definition MIDI.h:284
void sendActiveSensing()
Definition MIDI.h:119
unsigned long mSenderActiveSensingPeriodicity
Definition MIDI.h:286
MidiMessage mMessage
Definition MIDI.h:283
The main class for MIDI handling. It is templated over the type of serial port to provide abstraction...
Definition MIDI.h:55
void handleNullVelocityNoteOnAsNoteOff()
Definition MIDI.hpp:1080
bool inputFilter(Channel inChannel)
Definition MIDI.hpp:1091
bool parse()
Definition MIDI.hpp:783

References ActiveSensing, ActiveSensingTimeout, ErrorActiveSensingTimeout, handleNullVelocityNoteOnAsNoteOff(), inputFilter(), launchCallback(), mErrorCallback, MIDI_CHANNEL_OFF, mLastError, mLastMessageReceivedTime, mLastMessageSentTime, mMessage, mReceiverActiveSensingActivated, mSenderActiveSensingPeriodicity, parse(), sendActiveSensing(), and thruFilter().

+ Here is the call graph for this function: