View Single Post
Old 10-01-2018, 11:14 AM   #3
lorcan
Human being with feelings
 
lorcan's Avatar
 
Join Date: Sep 2009
Location: France
Posts: 18
Default

Quote:
Originally Posted by Justin View Post
How are you calculating the xpos/ypos that you pass? If converting from screen coordinates to your view coordinates, be sure to use [-NSWindow convertScreenToBase:] and [-NSView convertPoint:fromView:nil] (I believe other VST3s use these APIs and work correctly with REAPER).
The xpos/ypos is given to me through a Cocoa NSEvent. I get the position from there and invert the y coordinate to make it cross-platform agnostic for user code.
Quote:
Originally Posted by as per VST3 SDK docs:
Find out which parameter in Plug-in view is at given position (relative to Plug-in view).
Anyway I've found out that Reaper doesn't call findParameter() (by tracing).

Actually I think the problem lies elsewhere, in the host-side IContextMenu interface, the docs say
Code:
/// Pop-ups the menu.
/// Coordinates are relative to the top-left position of the Plug-ins view.
tresult IContextMenu::popup(UCoord x, UCoord y);
The coordinates I send to Reaper are in top-left, platform-independent coordinates (y upside down w.r.t to Cocoa conventions).
I've tried in Cubase, Studio One, FL Studio, Tracktion and VST3 SDK Test host and they all behave as intended.

I also tried the VST3 SDK plug-in samples and they do the same thing as my code (pass top-left coords) to Reaper, however their NSView returns YES for isFlipped (not the default), perhaps that could explain why Reaper displays the menu in the right position there?

So what do you suggest: should I implement a Reaper specific workaround in my code or should Reaper conform to the VST3 spec ?
__________________
lmdsp audio plug-ins
lorcan is offline   Reply With Quote