VideoPlayer.h 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. signals:
  34. void onVideoPlayerPlayMode(const int mode);
  35. void onVideoPlayerShowStatus(const int status);
  36. void onVideoPlayerPlayStatus(const int type, const int status);
  37. void onVideoPlayerFileNames(const int type, const QString &xml);
  38. //void onVideoPlayerFilePath(const int type, const QString& path);
  39. void onVideoPlayerInformation(const int type, const int index, const QString &fileName, const int endTime);
  40. void onVideoPlayerElapsedInformation(const int elapsedTime, const int elapsedMillesimal);
  41. void onVideoPlayerVisible(const bool flag);
  42. void onSliderTouchEnable(const bool flag); //dll add 20190805
  43. void onVideoPlayerExit();
  44. protected slots:
  45. void onDeviceWatcherStatus(const int type, const int status);
  46. void onVideoFilePath(const QString &path, const int type);
  47. private:
  48. explicit VideoPlayer(QObject* parent = NULL);
  49. ~VideoPlayer();
  50. VideoPlayerPrivate* const d_ptr;
  51. Q_DECLARE_PRIVATE(VideoPlayer)
  52. };
  53. #endif // VIDEOPLAYER_H