libpictureplayer.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #pragma once
  2. #include <stdio.h>
  3. #ifdef _WIN32
  4. #ifdef LIBPICTUREPLAYER_EXPORTS
  5. #define LIBPICTUREPLAYER_API __declspec(dllexport)
  6. #else
  7. #define LIBPICTUREPLAYER_API __declspec(dllimport)
  8. #endif
  9. # elif ( defined(__GNUC__) && __GNUC__ >= 4 )
  10. #define LIBPICTUREPLAYER_API __attribute__((visibility("default")))
  11. #else // _WIN32
  12. #define LIBPICTUREPLAYER_API
  13. #endif // _WIN32
  14. #ifdef _WIN32
  15. #ifndef RVC_NO_VTABLE
  16. #define RVC_NO_VTABLE __declspec(novtable)
  17. #endif // !RVC_NO_VTABLE
  18. #else
  19. #ifndef RVC_NO_VTABLE
  20. #define RVC_NO_VTABLE
  21. #endif // !RVC_NO_VTABLE
  22. #endif // _WIN32
  23. #ifndef MAX_FILECOUNT
  24. #define MAX_FILECOUNT 32
  25. #endif // !MAX_FILECOUNT
  26. #ifndef MAX_PATH
  27. #define MAX_PATH 260
  28. #endif
  29. struct CPicPlayConfig
  30. {
  31. bool bFullScreen; // 是否全屏
  32. bool bPrimMonitor; // 是否主屏显示
  33. int nWndX; // 窗口X坐标
  34. int nWndY; // 窗口Y坐标
  35. int nWndWidth; // 窗口宽度
  36. int nWndHeight; // 窗口高度
  37. int nFileCnt; // 文件个数
  38. int nPlayCnt; // 播放次数
  39. int nPlayInterval; // 播放时间间隔
  40. char strRootPath[MAX_PATH]; // 根目录
  41. char strFileNames[MAX_FILECOUNT][MAX_PATH]; // 文件名数组
  42. };
  43. struct RVC_NO_VTABLE CPicHostApi
  44. {
  45. virtual void PicDebug(const char* fmt, ...) = 0;
  46. virtual int LoadPlayConfig(CPicPlayConfig &config, int CfgInx = 0) = 0;
  47. };
  48. class libpictureplayer_impl;
  49. class LIBPICTUREPLAYER_API Clibpictureplayer
  50. {
  51. public:
  52. Clibpictureplayer(CPicHostApi* pHostApi);
  53. ~Clibpictureplayer();
  54. void Play(int nCfgInx, int nWndX, int nWndY, int nWndWidth, int nWndHeight);
  55. void PlayMedia(CPicPlayConfig& config);
  56. bool checkIsStop();
  57. bool checkIsPlay(void* pthreadid);
  58. void Close();
  59. private:
  60. libpictureplayer_impl* m_pImpl;
  61. };