RawReader.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "../Agave/DecodeFile/svc_raw_media_reader.h"
  3. #include "../Agave/DecodeFile/ifc_raw_media_reader.h"
  4. #include "main.h"
  5. // {4FB808DC-C327-4999-9822-BDDDE20F44B0}
  6. static const GUID sndfile_raw_reader_guid =
  7. { 0x4fb808dc, 0xc327, 0x4999, { 0x98, 0x22, 0xbd, 0xdd, 0xe2, 0xf, 0x44, 0xb0 } };
  8. class RawMediaReaderService : public svc_raw_media_reader
  9. {
  10. public:
  11. static const char *getServiceName() { return "SndFile Raw Reader"; }
  12. static GUID getServiceGuid() { return sndfile_raw_reader_guid; }
  13. int CreateRawMediaReader(const wchar_t *filename, ifc_raw_media_reader **reader);
  14. protected:
  15. RECVS_DISPATCH;
  16. };
  17. class RawMediaReader : public ifc_raw_media_reader
  18. {
  19. public:
  20. RawMediaReader() {}
  21. ~RawMediaReader();
  22. int Initialize(const wchar_t *filename);
  23. int Read(void *buffer, size_t buffer_size, size_t *bytes_read);
  24. size_t Release();
  25. protected:
  26. RECVS_DISPATCH;
  27. private:
  28. SNDFILE *soundFile = NULL;
  29. SF_INFO info;
  30. };