
#define MP3BUFFERSIZE	8192

#include <mad.h>

class MadPlayer
{
 public:MadPlayer(char *file);
        ~MadPlayer();
	void seek(int position);
 	int read(char *buf,int num);	
 private:
	 int refill(void);
         FILE *mp3in;
         struct mad_stream mp3stream;
         struct mad_frame mp3frame;
         struct mad_synth mp3synth;
         mad_timer_t mp3timer;
         unsigned char InputBuffer[MP3BUFFERSIZE];
         unsigned char OutputBuffer[MP3BUFFERSIZE];
	 int outputbuflen;
	 int outputbufptr;
	 int waveplay;

};

