
#ifndef MP3TOWAV
#define MP3TOWAV

#include <stdio.h>

class Process;

class MP3toWAV
{
	FILE *inStream;
	Process *mpg123;
	int leftInStream,
		writeBuf0, writeBuf1, readBufN,
		waveLength;
	char writeBuf[4 * 1024], readBuf[4 * 1024];
	enum { NORMAL, CLOSEOUT, OUTCLOSED, INCLOSED } mode;
public:
	MP3toWAV(FILE *inStream = NULL);
	~MP3toWAV();
	void end();
	int get(const char **buf);
	void put(int n);
	void setInStream(FILE *inStream);
	void updateHeader(FILE *outStream);
private:
	void fillReadBuf();
	void fillWriteBuf();
};

#endif

