Re: MIDIClientCreate Arguments
Re: MIDIClientCreate Arguments
- Subject: Re: MIDIClientCreate Arguments
- From: Matthew Hubble <email@hidden>
- Date: Mon, 28 Feb 2011 10:37:07 +0000
Aha!
So the pointer I supply will be passed as an argument to my callback
function (if I specify one), so I can access whatever I deem necessary
there. This makes sense now, thanks for helping an Apple Dev noob :-)
Matt
On 2/28/11 10:27 AM, Muon Software Ltd - Dave wrote:
I'm not familiar with the exact functions/API in question, but normally a callback function is a static/global function rather than a class member function - so assuming you're not using lots of other globals and have all your application logic nicely encapsulated in classes, you will not be able to access any of those classes from within the callback function.
So when you set up the callback, use the argument to pass over a pointer to whatever data or objects you will need access to in the callback. You will get given back the pointer via the same argument each time the callback fires so you can access your data. Then all you need to do is check it is valid and cast it to the appropriate type to use it.
Hope this helps
Dave
-----Original Message-----
From: coreaudio-api-bounces+dave=email@hidden [mailto:coreaudio-api-bounces+dave=email@hidden] On Behalf Of Matthew Hubble
Sent: Monday, February 28, 2011 9:48 AM
To: email@hidden
Cc: email@hidden
Subject: Re: MIDIClientCreate Arguments
So what does the function do with this pointer? What are some possible uses?
Thanks,
Matt
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden