AudioLayer.h 913 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef NULLSOFT_AUDIOLAYERH
  2. #define NULLSOFT_AUDIOLAYERH
  3. #include "WMHandler.h"
  4. #include <mmreg.h>
  5. #include "AudioThread.h"
  6. #include "AudioFormat.h"
  7. class AudioLayer : public WMHandler, public AudioFormat
  8. {
  9. public:
  10. AudioLayer(IWMReader *_reader);
  11. ~AudioLayer();
  12. bool IsOpen()
  13. {
  14. return opened;
  15. }
  16. void Kill();
  17. bool OpenAudio();
  18. void StartAudioThread();
  19. private:
  20. // WMHandler events
  21. void Opened();
  22. void SampleReceived(QWORD &timeStamp, QWORD &duration, unsigned long &outputNum, unsigned long &flags, INSSBuffer *&sample);
  23. void VideoCatchup(QWORD time);
  24. void Closed();
  25. void EndOfFile();
  26. void Started();
  27. void Stopped();
  28. // other people's data
  29. IWMReader *reader;
  30. // our data
  31. QWORD startPosition;
  32. int audioOutputNum;
  33. IWMReaderAdvanced2 *reader2;
  34. QWORD offset;
  35. DWORD new_offset;
  36. QWORD videoCatchup;
  37. bool opened;
  38. HANDLE killSwitch;
  39. int latency;
  40. AudioThread audioThread;
  41. };
  42. #endif