#ifndef AVIFILE_AUDIOCLEANER_H
#define AVIFILE_AUDIOCLEANER_H

#include <default.h>
#include <formats.h>
#include <cstring>

class IAudioCleaner
{
protected:
    static const size_t CLEARED_SAMPLES = 32;
    size_t clearSize;
public:
    IAudioCleaner(size_t clear) : clearSize(clear) {}
    virtual ~IAudioCleaner() {}
    virtual size_t soundOff(void* out, const void* in) = 0;
    virtual size_t soundOn(void* out, size_t n) = 0;
};

template <class T> class AudioCleanerStereo : public IAudioCleaner
{
public:
    AudioCleanerStereo(size_t clear) : IAudioCleaner(clear) {}
    size_t soundOff(void* out, const void* in);
    size_t soundOn(void* out, size_t n);
};

template <class T> class AudioCleanerMono : public IAudioCleaner
{
public:
    AudioCleanerMono(size_t clear) : IAudioCleaner(clear) {}
    size_t soundOff(void* out, const void* in);
    size_t soundOn(void* out, size_t n);
};

IAudioCleaner* CreateAudioCleaner(unsigned int channels,
				  unsigned int bitsPerSample,
				  size_t clearsz);

#endif // AVIFILE_AUDIOCLEANER_H
