QElapsedTimer issue : code works on LINUX but not on MAC OS
-
While it's strange, I wouldn't make the success of the initialization based on such a timer.
I'd rather have a signal telling the initialization is done once you received the MIDI message(s) you need. Then you can trigger the next step of your application.
-
Aren't you waiting on a set of known messages ?
-
You can write an initializer class that does only this and once done the messages are routed to your usual class.
-
Not so sure what you mean. Had a look on the WEB but did not find much.
The things is the MIDI reception is triggered by the MIDI lib (RTMIDI) when is callback the function it is setup to call back (MIDIcallback) and this function is not part of a class. So I would immagine that having an initializer class implies that having this MIDIcallback function inside that class. Just guessing here. -
You can pass anything you want in the userData parameter so you could use that to pass a custom Midi message handler.
In that handler you'll check the message that you receive and once you got all the initialization messages you can emit something like a "initialized" signal and then process the rest of the message normally.
-
You can pass a custom struct that contains all the pointers to objects you need.
-
True. I though about it at one point but didn't want to bother with it at the time ... I might just have to do that.
Thanks a lot for all your help.
But in the end, it seems the initial problem ( delay() not returning ) might be specific to Qt5.5.1 on mac. I will try it out with Qt5.6. Who knows it might work. ;)