This question arose quite a few times in this forum already, but none of the previous threads were any helpful in this particular case, unfortunately. For the life of me, I don’t have the slightest clue why my MidiInputCallback doesn’t receive any messages. This is roughly the scheme of things: I have two classes AbstractPort and MidiPort (there are more siblings to MidiPort, but that doesn’t matter here):
class AbstractPort
{
// shared stuff for managing ports in my project, e.g. port numbers, etc.
...
};
class MidiPort
: public AbstractPort,
public MidiInputCallback
{
public:
void handleIncomingMidiMessage (MidiInput* source, const MidiMessage& message);
private:
ScopedPointer<MidiOutput> output;
ScopedPointer<MidiInput> input;
};
In the member function MidiPort::start() the input gets launched as follows:
input = MidiInput::openDevice (whateverIndex, this);
input->start();
No matter how many MIDI events I feed into the corresponding driver (a small USB keyboard “nanoKEY” by Korg), the input callback does not fire. I traced everything in the debugger, to no avail. Of course, the keyboard works fine with the PluginHost example project.
I should note that my project sits in a Framework/DLL and thus has no access to the message thread of the application it is linked to. As an experiment, I implemented and included a FakeMessageThread (a 100% copy of SharedMessageThread), but that wasn’t helpful either.
And yes, I am using virtual members and destructors in AbstractPort.
The project is developed on MacOS X 10.5.8 currently.
Any idea what I might have overlooked?