1
0

WMDRMModule.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. #ifndef NULLSOFT_WMDRMMODULEH
  2. #define NULLSOFT_WMDRMMODULEH
  3. #include "Remaining.h"
  4. #include <wmsdk.h>
  5. // layers
  6. #include "AudioLayer.h"
  7. #include "VideoLayer.h"
  8. #include "ClockLayer.h"
  9. #include "WaitLayer.h"
  10. #include "BufferLayer.h"
  11. #include "SeekLayer.h"
  12. #include "GainLayer.h"
  13. #include "WMHandler.h"
  14. #include "WMCallback.h"
  15. #include "WMInformation.h"
  16. class WMDRM : public WMHandler
  17. {
  18. public:
  19. WMDRM();
  20. ~WMDRM();
  21. void Config(HWND hwndParent);
  22. void Init();
  23. void Quit();
  24. void GetFileInfo(const wchar_t *file, wchar_t *title, int *length_in_ms);
  25. int InfoBox(const wchar_t *file, HWND hwndParent);
  26. int IsOurFile(const wchar_t *fn);
  27. int Play(const wchar_t *fn);
  28. void Pause();
  29. void UnPause();
  30. int IsPaused();
  31. void Stop();
  32. int GetLength();
  33. int GetOutputTime();
  34. void SetOutputTime(int time_in_ms);
  35. void SetVolume(int volume);
  36. void SetPan(int pan);
  37. int GetVolume() { return volume; }
  38. int GetPan() { return pan; }
  39. void EQSet(int on, char data[10], int preamp);
  40. void BuildBuffers();
  41. void OutputAudioSamples(void *data, long samples, DWORD&);
  42. void OutputAudioSamples(void *data, long samples);
  43. void QuantizedViz(void *data, long sizeBytes, DWORD);
  44. long GetPosition();
  45. void EndOfFile();
  46. bool OpenVideo(int fourcc, int width, int height, bool flipped);
  47. void ReOpen();
  48. void NewSourceFlags();
  49. // const char *GetFile() { return fn.c_str();}
  50. bool playing;
  51. int startAtMilliseconds;
  52. void InitWM();
  53. protected:
  54. //WMHandler
  55. void AudioDataReceived(void *_data, unsigned long sizeBytes, DWORD timestamp);
  56. void Opened();
  57. void NewMetadata();
  58. void Closed();
  59. void Started();
  60. void Error();
  61. void OpenFailed();
  62. void Stopped();
  63. void Kill();
  64. BufferLayer *buffer;
  65. ClockLayer *clock;
  66. #ifndef NO_DRM
  67. DRMLayer *drm;
  68. #endif
  69. AudioLayer *audio;
  70. VideoLayer *video;
  71. WaitLayer *wait;
  72. SeekLayer *seek;
  73. GainLayer *gain;
  74. WMCallback callback;
  75. IWMReader *reader;
  76. IWMReaderAdvanced *reader1;
  77. IWMReaderAdvanced2 *reader2;
  78. IWMReaderNetworkConfig *network;
  79. WMInformation *info;
  80. Remaining remaining;
  81. unsigned char *dspBuffer, *vizBuffer;
  82. int volume, pan;
  83. bool flushed, paused;
  84. HANDLE killswitch;
  85. bool opened;
  86. bool drmProtected;
  87. void Connecting();
  88. void Locating();
  89. void AssignOutput();
  90. void AccessDenied();
  91. };
  92. #endif