ifc_ultravox_reader.h 1.3 KB

12345678910111213141516171819202122232425262728
  1. #pragma once
  2. #include "foundation/dispatch.h"
  3. class ifc_ultravox_reader : public Wasabi2::Dispatchable
  4. {
  5. protected:
  6. ifc_ultravox_reader() : Dispatchable(DISPATCHABLE_VERSION) {}
  7. ~ifc_ultravox_reader() {}
  8. public:
  9. enum
  10. {
  11. DISPATCHABLE_VERSION=0,
  12. };
  13. size_t BytesBuffered() { return UltravoxReader_BytesBuffered(); }
  14. int Read(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_Read(buffer, buffer_length, bytes_read); }
  15. int Peek(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_Peek(buffer, buffer_length, bytes_read); }
  16. int IsClosed() { return UltravoxReader_IsClosed(); }
  17. /* gives you back the contents of exactly one packet. used when Ultravox is provided codec framing */
  18. int ReadPacket(void *buffer, size_t buffer_length, size_t *bytes_read) { return UltravoxReader_ReadPacket(buffer, buffer_length, bytes_read); }
  19. private:
  20. virtual int WASABICALL UltravoxReader_Read(void *buffer, size_t buffer_length, size_t *bytes_read)=0;
  21. virtual int WASABICALL UltravoxReader_Peek(void *buffer, size_t buffer_length, size_t *bytes_read)=0;
  22. virtual size_t WASABICALL UltravoxReader_BytesBuffered()=0;
  23. virtual int WASABICALL UltravoxReader_IsClosed()=0;
  24. virtual int WASABICALL UltravoxReader_ReadPacket(void *buffer, size_t buffer_length, size_t *bytes_read)=0;
  25. };