1
0

MODPlayer.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include <bfc/platform/types.h>
  3. #include <libopenmpt/libopenmpt.h>
  4. #include "../nu/AudioOutput.h"
  5. class MODPlayer
  6. {
  7. public:
  8. MODPlayer(const wchar_t *_filename);
  9. ~MODPlayer();
  10. DWORD CALLBACK ThreadFunction();
  11. void Kill();
  12. void Seek(int seek_pos);
  13. int GetOutputTime() const;
  14. private:
  15. enum
  16. {
  17. // values that you can return from OnXXXX()
  18. MOD_CONTINUE = 0, // continue processing
  19. MOD_ABORT = 1, // abort parsing gracefully (maybe 'stop' was pressed)
  20. MOD_STOP = 2, // stop parsing completely - usually returned when mkv version is too new or codecs not supported
  21. // values returned from errors within the Step() function itself
  22. MOD_EOF = 3, // end of file
  23. MOD_ERROR = 4, // parsing error
  24. };
  25. HANDLE killswitch, seek_event;
  26. wchar_t *filename;
  27. volatile int m_needseek;
  28. /* AudioOutput implementation */
  29. class MODWait
  30. {
  31. public:
  32. void Wait_SetEvents(HANDLE killswitch, HANDLE seek_event);
  33. protected:
  34. int WaitOrAbort(int time_in_ms);
  35. private:
  36. HANDLE handles[2];
  37. };
  38. nu::AudioOutput<MODWait> audio_output;
  39. };