ifc_mpeg_stream_reader.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <bfc/dispatch.h>
  3. class ifc_mpeg_stream_reader : public Dispatchable
  4. {
  5. protected:
  6. ifc_mpeg_stream_reader() {}
  7. ~ifc_mpeg_stream_reader() {}
  8. public:
  9. int MPEGStream_Peek( void *buffer, size_t to_read, size_t *bytes_read );
  10. int MPEGStream_Read( void *buffer, size_t to_read, size_t *bytes_read );
  11. int MPEGStream_EOF();
  12. float MPEGStream_Gain();
  13. DISPATCH_CODES
  14. {
  15. MPEGSTREAM_PEEK = 0,
  16. MPEGSTREAM_READ = 1,
  17. MPEGSTREAM_EOF = 2,
  18. MPEGSTREAM_GAIN = 3,
  19. };
  20. };
  21. inline int ifc_mpeg_stream_reader::MPEGStream_Peek( void *buffer, size_t to_read, size_t *bytes_read )
  22. {
  23. return _call( MPEGSTREAM_PEEK, (int)1, buffer, to_read, bytes_read );
  24. }
  25. inline int ifc_mpeg_stream_reader::MPEGStream_Read( void *buffer, size_t to_read, size_t *bytes_read )
  26. {
  27. return _call( MPEGSTREAM_READ, (int)1, buffer, to_read, bytes_read );
  28. }
  29. inline int ifc_mpeg_stream_reader::MPEGStream_EOF()
  30. {
  31. return _call( MPEGSTREAM_EOF, (int)true );
  32. }
  33. inline float ifc_mpeg_stream_reader::MPEGStream_Gain()
  34. {
  35. return _call( MPEGSTREAM_GAIN, (float)1.0f );
  36. }