Hi Everyone,
I was hoping one of you kind souls could help me with the following:
I have a class method which initializes audio libraries written in C, shown below... where it says (RIGHT HERE) I am trying to create a pointer to the class MiniHost, am I doing it right?
>>>>>
void MiniHost::setup Audio()
{
////Some unimportant stuff here, then:
Pa_OpenStream(
&stream,
NULL,
&outputParamete rs,// ignore all this stuff
kSampleRate,
kBlockSize,
NULL,
patestCallback,
this); /////////// <- RIGHT HERE
Pa_StartStream( stream );
}
>>>>>
Here is the second part, a static method from which I am trying to call the class listed above:
>>>>>>>>>
static int patestCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer ,
const PaStreamCallbac kTimeInfo* timeInfo,
PaStreamCallbac kFlags statusFlags,
void *userData ) //I can't change this stuff, the libraries need it this way
{
userData->someFunction() ; //dosen't work
return paContinue;
}
>>>>>>>>>
What I need to do in the above code, is to call MiniHost through the 'userData' parameter, into which I tried to pass a pointer to the class.
Assuming I passed the pointer correctly, how do I call the class?
Thanks a lot!
Crispin
I was hoping one of you kind souls could help me with the following:
I have a class method which initializes audio libraries written in C, shown below... where it says (RIGHT HERE) I am trying to create a pointer to the class MiniHost, am I doing it right?
>>>>>
void MiniHost::setup Audio()
{
////Some unimportant stuff here, then:
Pa_OpenStream(
&stream,
NULL,
&outputParamete rs,// ignore all this stuff
kSampleRate,
kBlockSize,
NULL,
patestCallback,
this); /////////// <- RIGHT HERE
Pa_StartStream( stream );
}
>>>>>
Here is the second part, a static method from which I am trying to call the class listed above:
>>>>>>>>>
static int patestCallback( const void *inputBuffer, void *outputBuffer,
unsigned long framesPerBuffer ,
const PaStreamCallbac kTimeInfo* timeInfo,
PaStreamCallbac kFlags statusFlags,
void *userData ) //I can't change this stuff, the libraries need it this way
{
userData->someFunction() ; //dosen't work
return paContinue;
}
>>>>>>>>>
What I need to do in the above code, is to call MiniHost through the 'userData' parameter, into which I tried to pass a pointer to the class.
Assuming I passed the pointer correctly, how do I call the class?
Thanks a lot!
Crispin
Comment