COCKOS
CONFEDERATED FORUMS
Cockos : REAPER : NINJAM : Forums
Forum Home : Register : FAQ : Members List : Search :
Old 04-18-2009, 12:44 AM   #1
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default A couple of IPlug questions

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?
cc_ is offline   Reply With Quote
Old 04-18-2009, 05:09 AM   #2
schwa
Administrator
 
schwa's Avatar
 
Join Date: Mar 2007
Location: NY
Posts: 15,747
Default

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).
schwa is offline   Reply With Quote
Old 04-18-2009, 06:14 AM   #3
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

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_ is offline   Reply With Quote
Old 05-26-2009, 08:10 AM   #4
cc_
Human being with feelings
 
Join Date: Mar 2009
Posts: 256
Default

Quote:
Originally Posted by schwa View Post
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?
cc_ is offline   Reply With Quote
Old 04-03-2012, 08:40 AM   #5
olilarkin
Human being with feelings
 
Join Date: Apr 2009
Location: Berlin, Germany
Posts: 1,248
Default

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.
__________________
VirtualCZ | Endless Series | iPlug2 | Linkedin | Facebook
olilarkin is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:58 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.