0
0

Hi all.

I am coding a reverb effect and would like to put the callback funtion in a class appart of the application manager.

By taking a view at dsp custom example I have code an AudioManager that inits Fmod and manager all flow, also I want to make the dsp effect in another class.
So, at the initialization of the audio manager I put this code:

[code:1lghddq6]
/*
Create the DSP effects.
*/
{
FMOD_DSP_DESCRIPTION dspdesc;

    memset(&dspdesc, 0, sizeof(FMOD_DSP_DESCRIPTION)); 

    dspdesc.channels     = 0;                   // 0 = whatever comes in, else specify. 
    dspdesc.read         = &ReverbDsp::myDSPCallback; 
    dspdesc.userdata     = (void *)0x12345678; 

    result = system->createDSP(&dspdesc, &reverbDsp); 
    ERRCHECK(result); 
} 

[/code:1lghddq6]

And i have a class named ReverbDsp defining myDSPCallback like this:
[code:1lghddq6]
FMOD_RESULT F_CALLBACK ReverbDsp::myDSPCallback(FMOD_DSP_STATE *dsp_state, float *inbuffer, float *outbuffer, unsigned int length, int inchannels, int outchannels)
{
...
}
[/code:1lghddq6]

All this stuff generates the following compiler error:

[quote:1lghddq6]Error 1 error C2440: ‘=’ : cannot convert from ‘FMOD_RESULT (__stdcall ReverbDsp::* )(FMOD_DSP_STATE *,float *,float *,unsigned int,int,int)’ to ‘FMOD_DSP_READCALLBACK’ J:\Tgk\Projects\Audio\Reverb\Reverb\Reverb\AudioManager.cpp 51 1 Reverb
[/quote:1lghddq6]

I am new to fmod and currently remembering c++ coding, so sorry if my question seems silly 8)

  • You must to post comments
0
0

Setting myDSPCallback as static solves compilation error.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.