c_encoder_ogg.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef __C_ENCODER_OGG_H__
  2. #define __C_ENCODER_OGG_H__
  3. #include "c_encoder_nsv.h"
  4. //#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
  5. typedef struct
  6. {
  7. bool cfg_abr_use_max,cfg_abr_use_min;
  8. UINT cfg_mode;
  9. float cfg_vbrquality;
  10. UINT cfg_abr_nominal;
  11. UINT cfg_abr_max;
  12. UINT cfg_abr_min;
  13. } configtype;
  14. struct T_ENCODER_OGG_INFO : public T_ENCODER_NSV_INFO
  15. {
  16. float output_quality;
  17. unsigned int output_samplerate;
  18. unsigned int output_channelmode;
  19. };
  20. #define OGG_DEFAULT_OUTPUTMODE 0
  21. #define OGG_DEFAULT_OUTPUTBITRATE 192
  22. #define OGG_DEFAULT_OUTPUTSAMPLERATE 44100
  23. #define OGG_DEFAULT_OUTPUTQUALITY 2.0f
  24. class C_ENCODER_OGG : public C_ENCODER_NSV {
  25. private:
  26. HWND winamp;
  27. protected:
  28. virtual void FillAttribs();
  29. public:
  30. static HINSTANCE hEncoderInstance;
  31. C_ENCODER_OGG(HWND hwnd = 0);
  32. virtual ~C_ENCODER_OGG();
  33. static bool isPresent(HWND winamp);
  34. virtual void ReadConfFile(char * conf_file, char * section=NULL);
  35. virtual void FillConfFile(char * conf_file, char * section=NULL);
  36. static void Unload() { if(hEncoderInstance) FreeLibrary(hEncoderInstance); hEncoderInstance=0; }
  37. virtual char * GetContentType() { return "audio/ogg"; }
  38. virtual HINSTANCE GetEncoderInstance() { return hEncoderInstance; }
  39. };
  40. #endif /* !__C_ENCODER_OGG_H__ */