AudioThread.h 785 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef NULLSOFT_AUDIOTHREADH
  2. #define NULLSOFT_AUDIOTHREADH
  3. #include "WMHandler.h"
  4. #include "MediaThread.h"
  5. #include <wmsdk.h>
  6. class AudioLayer;
  7. class AudioThread : public MediaThread
  8. {
  9. public:
  10. AudioThread(AudioLayer *audio);
  11. void Start(WMHandler *output);
  12. /* AddBuffers put an audio buffer in the queue
  13. it returns true if it was added
  14. it returns false if it was NOT added. it is up to YOU (the caller) to sleep for a while and call again
  15. */
  16. void AudThread();
  17. bool EndOfFile()
  18. {
  19. if (buffers.empty()) // if the buffers are empty, then our thread might never get a chance to signal EOF
  20. return true;
  21. if (eof)
  22. return true;
  23. eof=1;
  24. return false;
  25. }
  26. private:
  27. void AddAPC(MediaBuffer *);
  28. int eof;
  29. WMHandler *output;
  30. AudioLayer *audioLayer;
  31. };
  32. #endif