View Single Post
Old 05-02-2019, 02:21 AM   #1
pressplay
Human being with feelings
 
pressplay's Avatar
 
Join Date: Sep 2017
Location: Berlin
Posts: 47
Default add midi messages to queue using a button

Hey guys,

I have a problem (challenge) with the following scenario in a iplug1 plug-in:

In ProcessDoubleReplacing I iterate over an IMidiQueue and process the midi messages. The messages are added to the queue in ProcessMidiMsg. Now, I want to add and remove another set of messages when a button is clicked/released (OnMouseDown, OnMouseUp). It does not matter if they are put into a separate queue or into the same. In any case, I don't think that IMidiQueue is prepared for this multithreaded use case. What if a message is removed while reading from the queue?

Have you ever added midi messages to the IMidiQueue from another context than ProcessMidiMsg? If so, how did you do this?

Thanks
Peat
pressplay is offline   Reply With Quote