Hi, folks!
I would like to integrate the audio features of the Tracktion Engine into a Qt application. This is the code for the runDispatchLoop() method:
void MessageManager::runDispatchLoop()
{
jassert (isThisTheMessageThread()); // must only be called by the message thread
while (quitMessageReceived.get() == 0)
{
JUCE_TRY
{
if (! dispatchNextMessageOnSystemQueue (false))
Thread::sleep (1);
}
JUCE_CATCH_EXCEPTION
}
}
I couldn’t find any public method that would poll and dispatch the queued messages and then return, so I was wondering if something like:
void MessageManager::dispatchQueuedMessages()
{
jassert (isThisTheMessageThread()); // must only be called by the message thread
dispatchNextMessageOnSystemQueue (true);
}
would do the trick, because this way I could call that from my main Qt thread (or any other non-juce event loop really) and wouldn’t need to deal with the two different threads accessing the same set of data.
Thanks!
