VideoPlayer.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #ifndef VIDEOPLAYER_H
  2. #define VIDEOPLAYER_H
  3. #include "DeviceWatcher/DeviceWatcher.h"
  4. #include <QObject>
  5. #include <QProcess>
  6. #include <QScopedPointer>
  7. class VideoPlayerPrivate;
  8. class VideoPlayer : public QObject
  9. {
  10. Q_OBJECT
  11. #ifdef g_VideoPlayer
  12. #undef g_VideoPlayer
  13. #endif
  14. #define g_VideoPlayer (VideoPlayer::instance())
  15. public:
  16. inline static VideoPlayer* instance() {
  17. static VideoPlayer* videoPlayer(new VideoPlayer(qApp));
  18. return videoPlayer;
  19. }
  20. void videoPlayerRequestFileNames(const int type);
  21. void videoPlayerSetPlayModeToggle();
  22. void videoPlayerSetPlayMode(const int mode);
  23. void videoPlayerSetPlayStatusToggle();
  24. void videoPlayerSetPlayStatus(const int status);
  25. void videoPlayerPlayListViewIndex(const int type, const int index, const int x, const int y, const int width, const int height, const int millesimal);
  26. void videoPlayerPlayPreviousListViewIndex();
  27. void videoPlayerPlayNextListViewIndex();
  28. void videoPlayerSeekToMillesimal(const int millesimal);
  29. void videoPlayerExit();
  30. void videoPlayerVisible(const bool flag);
  31. void playVideoIndex(const DeviceWatcherType type, const int index, const int x, const int y, const int width, const int height, const int millesimal);
  32. void videoPlayerSetGeometry(int x,int y,int width,int height);
  33. void videoPlayerDeleteListItem(int index);//ADD 在USB视频编辑模式下删除视频文件 需要Service对应删除list内的元素
  34. void startDeleteVideoListItem();//ADD
  35. void writeCmdToMplayer(char* cmd);
  36. pthread_t getVideoPthreadValue();
  37. signals:
  38. void onVideoPlayerPlayMode(const int mode);
  39. void onVideoPlayerShowStatus(const int status);
  40. void onVideoPlayerPlayStatus(const int type, const int status);
  41. void onVideoPlayerFileNames(const int type, const QString &xml);
  42. //void onVideoPlayerFilePath(const int type, const QString& path);
  43. void onVideoPlayerInformation(const int type, const int index, const QString &fileName, const int endTime);
  44. void onVideoPlayerElapsedInformation(const int elapsedTime, const int elapsedMillesimal);
  45. void onVideoPlayerVisible(const bool flag);
  46. void onSliderTouchEnable(const bool flag); //dll add 20190805
  47. void onVideoPlayerExit();
  48. protected slots:
  49. void onDeviceWatcherStatus(const int type, const int status);
  50. void onVideoFilePath(const QString &path, const int type);
  51. void onTimeout();
  52. private:
  53. explicit VideoPlayer(QObject* parent = NULL);
  54. ~VideoPlayer();
  55. VideoPlayerPrivate* const d_ptr;
  56. Q_DECLARE_PRIVATE(VideoPlayer)
  57. };
  58. #endif // VIDEOPLAYER_H