@@ -42,11 +42,10 @@ inline MidiInterface<Transport, Settings, Platform>::MidiInterface(Transport& in
4242 , mCurrentNrpnNumber (0xffff )
4343 , mLastMessageSentTime (0 )
4444 , mLastMessageReceivedTime (0 )
45- , mSenderActiveSensingPeriodicity (0 )
4645 , mReceiverActiveSensingActivated (false )
4746 , mLastError (0 )
47+ , mSenderActiveSensingPeriodicity (Settings::SenderActiveSensingPeriodicity)
4848{
49- mSenderActiveSensingPeriodicity = Settings::SenderActiveSensingPeriodicity;
5049}
5150
5251/* ! \brief Destructor for MidiInterface.
@@ -765,7 +764,7 @@ inline bool MidiInterface<Transport, Settings, Platform>::read(Channel inChannel
765764 // assume that the connection has been terminated. At
766765 // termination, the receiver will turn off all voices and return to
767766 // normal (non- active sensing) operation.
768- if (Settings::UseSenderActiveSensing && (mSenderActiveSensingPeriodicity > 0 ) && ( Platform::now () - mLastMessageSentTime ) > mSenderActiveSensingPeriodicity )
767+ if (Settings::UseSenderActiveSensing && (Platform::now () - mLastMessageSentTime ) > Settings::SenderActiveSensingPeriodicity )
769768 {
770769 sendActiveSensing ();
771770 mLastMessageSentTime = Platform::now ();
@@ -1407,6 +1406,10 @@ template<class Transport, class Settings, class Platform>
14071406inline MidiInterface<Transport, Settings, Platform>& MidiInterface<Transport, Settings, Platform>::turnThruOff()
14081407{
14091408 mThruFilterCallback = thruOff;
1409+ if (Settings::UseSenderActiveSensing)
1410+ {
1411+ mLastMessageSentTime = Platform::now ();
1412+ }
14101413 return *this ;
14111414}
14121415
0 commit comments