PDA

View Full Version : A couple of IPlug questions


cc_
04-18-2009, 12:44 AM
I was wondering about a couple of things:

1) I want to overlay some text (or maybe a bitmap) on a button, but have the button get the clicks (at the moment the text seems to get the clicks and the button does nothing). Is there an easy way to do this?

2) I want to set some gui text from processreplacing, would this need some locking? From what I can figure out there's one lock for when processreplacing runs, and the gui gets this lock when it want to update a parameter. I couldn't find any locking going the other way (when processreplacing updates a control), but I guess this is OK as it's only updating one number at the moment? I'm thinking that updating a string is a bit more dangerous though, so maybe I'd need a lock?

schwa
04-18-2009, 05:09 AM
For the text, set its targetrect to 0,0,0,0 and it won't capture any mouse action.

For moving strings between the audio and gui thread, it would be safest to lock the gui mutex (the audio mutex is already locked in that context).

cc_
04-18-2009, 06:14 AM
Thanks, the target rect worked great.

I will give the gui mutex a try when I get there. I'm a bit worried that there might be the potential for deadlock in there though, if a control is waiting on a the processreplacing mutex to update a parameter, then the processreplacing code tries to get the gui mutex?

cc_
05-26-2009, 08:10 AM
For moving strings between the audio and gui thread, it would be safest to lock the gui mutex (the audio mutex is already locked in that context).

I finally got to this... but it looks like the gui mutex is never locked (the code is commented out). Was there some problem with it? Or was it just that you didn't need it?

olilarkin
04-03-2012, 08:40 AM
resurrecting this old thread. I also wonder why all the mutex stuff in IGraphics* is commented out.

let's say for an oscilloscope plugin, what is the best approach in order to share an array of sample values between gui and process? The values need to be drawn in TheControl:: Draw(), called by the gui thread and buffered in ProcessDoubleReplacing() called by the real-time audio thread. I think some extra locking is needed.