libwmpplayer.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #pragma once
  2. #ifdef LIBWMPPLAYER_EXPORTS
  3. #define LIBWMPPLAYER_API __declspec(dllexport)
  4. #else
  5. #define LIBWMPPLAYER_API __declspec(dllimport)
  6. #endif
  7. #define TIME_LEN 9
  8. #define MAX_FILECOUNT 32
  9. enum PlayModeEnum
  10. {
  11. UNKNOWN = -1, // 未知
  12. SINGLE, // 单一
  13. SALESRECORD, // 客户经理
  14. LOCALAUDIO, // 本地音频
  15. LOCALVIDEO, // 本地视频
  16. THRIDSALESRECORD // 3.0客户经理双录
  17. };
  18. struct CWmpPlayConfig
  19. {
  20. char strVideoRunTime_S[TIME_LEN]; // 每天允许视频播放的起始时间
  21. char strVideoRunTime_E[TIME_LEN]; // 每天允许视频播放的终止时间
  22. bool bFullScreen; // 是否全屏
  23. bool bPrimMonitor; // 是否主屏显示
  24. bool bSimpleMode; // 是否简洁模式
  25. PlayModeEnum eMode; // 播放模式
  26. int nWndX; // 窗口X坐标
  27. int nWndY; // 窗口Y坐标
  28. int nWndWidth; // 窗口宽度
  29. int nWndHeight; // 窗口高度
  30. int nFileCnt; // 文件个数
  31. int nPlayCnt; // 播放次数
  32. int nPlayInterval; // 播放时间间隔
  33. char strNamePrefix[MAX_PATH]; // 客户经理录像名前缀
  34. char strRootPath[MAX_PATH]; // 根目录
  35. char strFileNames[MAX_FILECOUNT][MAX_PATH]; // 文件名数组
  36. // add by ly
  37. HANDLE h_WMPCreateEvent;
  38. HANDLE h_WMPPlayEndEvent;
  39. int nVolume; // 音量
  40. };
  41. struct __declspec(novtable) CWmpHostApi
  42. {
  43. virtual BOOL LoadPlayConfig(CWmpPlayConfig &config, int CfgInx = 0) = 0;
  44. virtual void WmpDebug(const char *fmt, ...) = 0;
  45. };
  46. class libwmpplayer_impl; // 桥接
  47. class LIBWMPPLAYER_API Clibwmpplayer
  48. {
  49. public:
  50. Clibwmpplayer(CWmpHostApi *pHostApi);
  51. ~Clibwmpplayer();
  52. VOID PlayVideo(const char *pVideoDir, const char *pNamePrefix = NULL, int nVideoCount = 1);
  53. VOID PlayLocalAudio(const char *pAudioNames);
  54. VOID PlayLocalVideo(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight);
  55. VOID Close();
  56. BOOL checkIsPlay(HANDLE &curThread);
  57. BOOL checkIsStop();
  58. VOID PlayMedia(CWmpPlayConfig &config);
  59. VOID SetVolume(int nVolume);
  60. VOID PlaySalesRecordVideo(int nWndX, int nWndY, int nWndWidth, int nWndHeight, const char *pVideoDir, const char *pNamePrefix = NULL, int nVideoCount = 1);
  61. private:
  62. libwmpplayer_impl *m_pImpl;
  63. };