I needed a callback version of PortMidi for my Windows app. I modified the library to accept a callback function when opening a midi input stream. Then, in the Windows implementation, I call this callback instead of inserting the PmEvent into the queue.
For my purposes this seems to work well, the queue stays empty and I get the PmEvent's, both short and Sysex, sent straight to my callback function. Of course this isn't portable and I'm not recommending anyone else do this :) But I did want to ask, should I anticipate any major problems with this approach? It looks like the Windows Midi callback does use EnterCriticalSection() and LeaveCriticalSection(). I need to do more research about what that entails.
Forgive me if I'm posting this question in the wrong place. I couldn't find any Portmidi forum anywhere else.
I needed a callback version of PortMidi for my Windows app. I modified the library to accept a callback function when opening a midi input stream. Then, in the Windows implementation, I call this callback instead of inserting the PmEvent into the queue.
For my purposes this seems to work well, the queue stays empty and I get the PmEvent's, both short and Sysex, sent straight to my callback function. Of course this isn't portable and I'm not recommending anyone else do this :) But I did want to ask, should I anticipate any major problems with this approach? It looks like the Windows Midi callback does use EnterCriticalSection() and LeaveCriticalSection(). I need to do more research about what that entails.
Forgive me if I'm posting this question in the wrong place. I couldn't find any Portmidi forum anywhere else.