00001 #ifndef ENCODER_H_ 00002 #define ENCODER_H_ 00003 00004 #include <sys/types.h> 00005 #include <stdio.h> 00006 00007 #define EENCODEERROR -1 00008 #define EPARTIALSAMPLE -2 00009 #define ENOTIMPL -3 00010 00011 class Metadata; 00012 00013 class Encoder 00014 { 00015 public: 00016 Encoder(const QString &outfile, int qualitylevel, Metadata *metadata); 00017 virtual ~Encoder(); 00018 virtual int addSamples(int16_t * bytes, unsigned int len) = 0; 00019 00020 virtual bool isValid() { return (m_out != NULL); } 00021 00022 protected: 00023 const QString m_outfile; 00024 FILE *m_out; 00025 int m_quality; 00026 Metadata *m_metadata; 00027 }; 00028 00029 #endif