Re: Unable to figure out Input Callback in cpp
Re: Unable to figure out Input Callback in cpp
- Subject: Re: Unable to figure out Input Callback in cpp
- From: "B.J. Buchalter" <email@hidden>
- Date: Thu, 21 Dec 2006 15:57:04 -0500
- Thread-topic: Unable to figure out Input Callback in cpp
Title: Re: Unable to figure out Input Callback in cpp
Make your callback routine a static member, and use the refcon to recover the pointer to your object. Then call a non-static member to do the work, or access the members of your object from the recovered object pointer within the static callback routine.
Basic rule: Callbacks from the OS must be file-scoped or static members. On the Mac with CW and GCC, static members work fine; there are other compilers on other machines that may actually require file-scoped external routines for use as a callback, but it doesn’t seem to apply on the Mac.
On 12/21/06 3:42 PM, "Jimmy Johnson" <email@hidden> wrote:
This might be more of a C++ question than a CoreAudio question, but it does have to do with core audio. I am trying to rewrite a Core AUdio program using C++ that I had working in C.
I am having the following problem when trying to setup the Callback procedure:
error: argument of type 'OSStatus (ChromaTunerAudio::)(void*, AudioUnitRenderActionFlags*, const AudioTimeStamp*, UInt32, UInt32, AudioBufferList*)' does not match 'OSStatus (*)(void*, AudioUnitRenderActionFlags*, const AudioTimeStamp*, UInt32, UInt32, AudioBufferList*)'
As you can see it is complaining because my scope does not match the defined scope of the callback.
This might be really easy but I am stumped. How do I get around this and keep my callback procedure in its own class definition?
Thanks!
James
_______________________________________________
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
B.J. Buchalter
Metric Halo
5 Donovan Drive
Hopewell Junction, NY 12533 USA
tel +1 845 223-6112
fax +1 603 250-2451
_______________________________________________
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