#include <audioencoder.h>

extern "C"
{
#include "lame3.70/lame.h"
}

class MP3Encoder: public IAudioEncoder
{
    lame_global_flags gf;
    WAVEFORMATEX in_fmt;
public:
    MP3Encoder(const CodecInfo& info, WAVEFORMATEX* format);
    ~MP3Encoder();
    virtual int SetBitrate(int bitrate);
    virtual int SetQuality(int quality);
    virtual int GetFormatSize();
    virtual int GetFormat(void* extension, size_t size);
    virtual int Start();
    virtual int Convert(const void* in_data, size_t in_size,
			void* out_data, size_t out_size,
			size_t* size_read, size_t* size_written);
    virtual int Close(void* out_data, size_t out_size, size_t* size_read);
};
