tags:

views:

51

answers:

1

Does midiOutPrepareHeader, midiInPrepareHeader just setup some data fields, or does it do something that is more time intensive?

I am trying to decide whether to build and destroy the MIDIHDR's as needed, or to maintain a pool of them.

+1  A: 

You really have only two ways to tell (without the Windows source):

1) Profile it. Depending on your findings for how long it takes, have a debug-only scoped timer that logs when it suddenly takes longer than what you think is acceptable for your application, or do your pool solution. Though the docs say not to modify the buffer once you call the prepare function, and it seems if you wanted to re-use it you may have to modify it. I'm not familiar enough with the docs to say one way or the other if your proposed solution would work.

2) Step through the assembly and see. Don't be afraid. Get the MSFT public symbols and see if it looks like it's just filling out fields or if it's doing something complicated.

jeffamaphone
The public symbols did help a lot.
jyoung