The original version of this page can be found at : http://forum.makemusic.com/default.aspx?f=11&m=84423
Posted By : dml - 7/5/2004 2:55 PM
Is there a way with the PDK to determine the closest EXNOTE/EXENTRY to a given screen/document coordinate?

Ideally, I'd like something like "EXENTRY* getClosest(int x, int y)", but any of the following suffice:

- Return the bounding box coordinates of a measure
- Return the bounding box coordinates of a note
- etc.

As you can see, I just need some mapping between what the API generally has (measures, notes, etc.) and actual coordinates.

Does anyone know of any way to do this within a plug-in?

Thanks in advance.

-Dave

Posted By : Michael Good - 7/6/2004 2:33 PM
Hi Dave,

I don't know of any hit test / bounding box functions in the PDK. You might be able to fake it with entry metrics, but that would probably be both slow and complex.

It sure would make a nice addition to a future version of the PDK!


Michael Good
Recordare LLC
 


Posted By : dml - 7/20/2004 10:41 AM
Hi Michael,

Thanks for the reply. I have since tried to use Entry Metrics but to no avail.

FX_GetEntryMetrics and FX_GetTGFEntryMetrics seem to always fail (i.e. return NO) even when I am quite sure that the arguments I give it are correct.

Have you used them before? Can you provide any insight?

Thanks.

-Dave

Posted By : dml - 7/20/2004 8:32 PM
Nevermind; I got it now.
 
-Dave

Posted By : dml - 8/29/2004 2:24 PM
For anyone interested, I have written code to determine what entries are in a given bounding box.

I can make the code accessible if anyone's interested.

-Dave

Posted By : Jari Williamsson - 9/7/2004 5:52 PM
dml said...
For anyone interested, I have written code to determine what entries are in a given bounding box.

I can make the code accessible if anyone's interested.


Sounds interesting! Could you post in on the finpdk group's file space? I guess there are more developers there who are interested in seeing it!


Jari Williamsson

Windows XP, Pentium 4
2.40 GHz, 1 GB RAM