Hello All,
I am using the SDL library for sound in my QT application (since somehow my
native platform does not suppot sound using QT). I have created a seperate
class for sound and am trying to compile my project but I keep getting the
following errors:
Error 1: argument of type 'void MyClass::)(void*, Uint8*, int) does not
match ‘void ()(void , Uint8, int)'
Error 2: argument of type 'void (MyProgram::)(int) does not match void ()
(int)’
My program structure looks like this:-----------------------------------------------------------------
myclass.h
struct {
SDL_AudioSpec spec;
Uint8 *sound;
Uint32 soundlen;
int soundpos;
} wave;
static int done = 0;
class MyClass
{
void fillerup(void *, Uint8 *, int);
void poked(int);
void play (char *);
};
myclass.cpp
void MyClass::poked(int sig)
{
done = 1;
}
void MyClass:: fillerup(void *unused, Uint8 *stream, int len)
{
//code here
}
void MyClass::play(char *file)
{
//some code
wave.spec.callback = fillerup; error is here for error 1
//some code
signal(SIGHUP, poked); //error is here for error 2
}
I guess it is because of somekind of callback issue. How do I resolve this?
Please help me define a class structure for the above program that works. I
have reference loopwave.c for the audio code.
Regards
Dhruv