0
0

Hi,

I’ve created a (simple) mp3-mixer and made a class for handling the dsp-stuff, named CDsp (how original…I know). The problem is a bit vage in my opinion…well, first my code:


——————————— CDsp.h ——————————–

ifndef CDspH

define CDspH

include <Classes.hpp>

include “Fmod.h”

include “Fmod_errors.h”

class CDsp{

public:
    FSOUND_DSPUNIT *DspUnit;

    CDsp();
    ~CDsp();

    void *DspCallBack (void *OriginalBuffer, void *NewBuffer, int Length, int Param);
    void *CreateDsp();

};

endif


——————————– CDsp.cpp ——————————–

pragma hdrstop

include “CDsp.h”

void *CDsp::DspCallBack(void *OriginalBuffer, void *NewBuffer, int Length, int Param)
{
return &NewBuffer;
}

void *CDsp::CreateDsp()
{
DspUnit=FSOUND_DSP_Create(&DspCallBack, FSOUND_DSP_DEFAULTPRIORITY_SFXUNIT, 0);
FSOUND_DSP_SetActive(DspUnit, false);
}

CDsp::CDsp()
{
}

CDsp::~CDsp()
{
FSOUND_DSP_SetActive(DspUnit, false);
FSOUND_DSP_Free(DspUnit);
}

pragma package(smart_init)


When compiling, I receive the error:

[C++ Error] CDsp.cpp(15): E2342 Type mismatch in parameter ‘callback’ (wanted ‘void * ()(void *,void *,int,int)’, got ‘void * ( (_closure )(void *,void *,int,int))(void *,void *,int,int)’)

Further I tried any variant I could think of, but I’m totally stuck here. Does anybody here have a clue what might be the problem or explain to me what this “_closure”-thing exactly is? That would be greatly appreciated…

Thanx in advance,

Rick Verdonschot

  • You must to post comments
0
0

Allright….thanks a lot…I changed the function decleration to

static void *CDsp::DspCallBack(void *OriginalBuffer, void *NewBuffer, int Length, int Param)

and now it’s working fine! Thanx!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.