1
0

ExtendedReader.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #ifndef NULLSOFT_WINAMP_EXTENDEDREADER_H
  2. #define NULLSOFT_WINAMP_EXTENDEDREADER_H
  3. #include <stddef.h>
  4. #include "../Agave/DecodeFile/ifc_audiostream.h"
  5. #include "../Agave/DecodeFile/api_decodefile.h"
  6. #include "CommonReader.h"
  7. typedef intptr_t (__cdecl *OpenFunc)(const char *filename, int *size, int *bps, int *nch, int *srate);
  8. typedef intptr_t (__cdecl *OpenWFunc)(const wchar_t *filename, int *size, int *bps, int *nch, int *srate);
  9. typedef size_t (__cdecl *GetDataFunc)(intptr_t handle, void *buffer, size_t bufferBytes, int *killswitch);
  10. typedef void (__cdecl *CloseFunc)(intptr_t);
  11. typedef int (__cdecl *SetTimeFunc)(intptr_t handle, int millisecs);
  12. class ExtendedReader : public CommonReader
  13. {
  14. public:
  15. ExtendedReader(OpenFunc _open, OpenWFunc _openW, OpenFunc _openFloat, OpenWFunc _openWFloat, GetDataFunc _getData, CloseFunc _close, SetTimeFunc _setTime = 0);
  16. ~ExtendedReader();
  17. bool Open(const wchar_t *filename, AudioParameters *parameters);
  18. size_t ReadAudio(void *buffer, size_t sizeBytes);
  19. size_t ReadAudio_kill(void *buffer, size_t sizeBytes, int *killswitch, int *error);
  20. BOOL SeekToTimeMs(int millisecs);
  21. int CanSeek();
  22. OpenFunc open, openFloat;
  23. OpenWFunc openW, openWFloat;
  24. GetDataFunc getData;
  25. CloseFunc close;
  26. SetTimeFunc setTime;
  27. intptr_t handle;
  28. protected:
  29. RECVS_DISPATCH;
  30. };
  31. #endif