Possible Issue with midiKeyStateChanged() CallBack

I have a MidiRecordingComponent that inherits from te::MidiInputDevice::MidiKeyChangeDispatcher::Listener and uses the midiKeyStateChanged() callback to display notes as MIDI is performed. This has been working well up until about a week ago.

Now, as MIDI is performed, nothing is displayed and I have discovered that midiKeyStateChanged() is never called.

I am always on the most recent JUCE Develop and TracktionEngine Develop.

Are there any recent changes that may have impacted this part of the code?

I don’t think so. It should get called from MidiInputDevice::timerCallback().

Are you sure you’ve assigned the input to the track fully?
Maybe step through MidiInputDevice::getDestinationTracks() to ensure your track appears there?

MIdi gets recorded, so the midi input is not an issue.

I use the MidiRecordingComponent to display midi being played while it is recorded. It is a visual reference for the musician to see that midi is being recorded as expected. Otherwise, you have to wait until you press STOP for the midi notes displayed. My MidiRecordingComponent has been working fine up until about a week ago. Then suddenly it stopped. In my testing I can see that midiKeyStateChanged is never called, which explains why nothing is displayed.

I have not made any changes to that code in over a year. So, I thought perhaps some of the recent changes to both JUCE and TracktionEngine may have changed the way things are working.

All of my recent code changes are UI related, and nothing to do with MIDI anyway. I am not sure what to try next.

What I have found is that when MidiInputDevice::getDestinationTracks() is called in MidiInputDevice::timerCallback() it does not contain any tracks?! This is in spite of the fact that MIDI is successfully recorded to the track!

How is it possible for the MIDI to be successfully recorded and yet MidiInputDevice::getDestinationTracks() contains nothing?

I select the input device with inputDevice->setTargetTrack(*currentAudioTrack, 0, true);. And I added code to see that it has been assigned.

if(inputDevice->isOnTargetTrack(*currentAudioTrack))
	juce::AlertWindow::showMessageBoxAsync(AlertWindow::InfoIcon,
                                            "TrackHeader", 
                                            "This track is assigned");

The AlertWindow indeed shows that the track is assigned to the input device. And, again, MIDI is successfully recorded.

So, how is it that MidiInputDevice::getDestinationTracks() is empty?

What steps do you recommend to troubleshoot this?

Have you implemented UIBehaviour::getLastFocusedEdit()?

That was it!

I had commented out my implementation of UIBehaviour::getLastFocusedEdit() in a search for potentially unused code and forgot to uncomment it. Definitely a case of shooting myself in the foot!

Thank you for your help.