RTAS ChooseControl

Hello,

I’m working on a RTAS plug-in (using Juce 1.53 and PT SDK 9) and got some feature requests to provide the ProTools auto parameter view feature.
In the meantime I learned that this feature refers to the ChooseControl function in the ProTools SDK. ProTools calls this function whenever a Ctrl-Cmd-Click is registered. However Juce seems to accept all mouse events and ProTools doesn’t get noticed about the click.
I already got this running under windows simply by not accepting a related mouse event.
However I got stuck on the Mac. When I got things right, Juce creates a JuceNSView for the plug-in and also a JuceNSWindow. While the view has no parent, the window is child of the host window. The view handles all mouse events and translates them into the Juce world. I guess the event needs to be send over to the host somehow. I already tried to call mouseDown in the host window and host view instance, but that didn’t do it. I managed to get a ChooseControl call once I set setIgnoresMouseEvents(true) for the plug-in window, but this of course disabled the plug-in mouse handling. At least I know that I’m on the right way.

I’m not so much into Mac event handling, hope one of you can give me some hint.

Thank you,
Marko

Have you tried getting the parent NSView of the juce component and just calling its mouseDown: method directly when the click happens? I think you can probably get the current event object with [NSEvent currentEvent] (or something like that), and just pass that event object onwards to the parent view.

Hi Jules. Thank you for helping me on this one!
I see a host window and its host (content) view and a plug-in window and its plug-in view (refered to juce_RTAS_MacUtilities.mm attachSubWindow:).
The plug-in view is created without parent as a JuceNSView. The mouseDown: of this JUCE view is called on each mouse click.
What I tried so far is to call the mouseDown: of the host view. But that didn’t do it. Is that what you ment?

Yes. Not really sure what else you could do if it doesn’t respond to that.

I don’t know much about this “ChooseControl” thing, but is it a function you can just call directly instead of passing on the mouse message and letting the host call it?

Ok, sounds that I’m on the right way. I think I’ll play around with that host view some more.

The host calls ChooseControl to ask the plug-in for the parameter id at a clicked position in the GUI.
It’s something that a plug-in can provide, but sadly the host need to initiate the call. I think they changed that in AAX.

Hi! did you achieve some patch, at least so that Pro Tools know that you clicked somewhere in the UI? (However we are using Juce 2 now…)