MultimediaPersistent.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #ifndef MULTIMEDIAPERSISTENT_H
  2. #define MULTIMEDIAPERSISTENT_H
  3. #include <QtGlobal>
  4. enum DeviceWatcherType {
  5. DWT_Undefine = -1,
  6. DWT_SDDisk = 0,
  7. DWT_USBDisk = 1,
  8. };
  9. #define DeviceWatcherType int
  10. enum DeviceWatcherStatus {
  11. DWS_Undefine = -1,
  12. DWS_Empty = 0,
  13. DWS_Unsupport = 1,
  14. DWS_Busy = 2,
  15. DWS_Ready = 3,
  16. DWS_Remove = 4,
  17. };
  18. #define DeviceWatcherStatus int
  19. enum MusicPlayerPlayMode {
  20. MPPM_AllRepeat = 0,
  21. MPPM_Shuffle = 1,
  22. MPPM_RepeatOnce = 2,
  23. };
  24. #define MusicPlayerPlayMode int
  25. enum MusicPlayerPlayStatus {
  26. MPPS_Undefine = -1,
  27. MPPS_Start = 0,
  28. MPPS_Unsupport = 1,
  29. MPPS_Stop = 2,
  30. MPPS_Pause = 3,
  31. MPPS_Play = 4,
  32. MPPS_Exit = 5,
  33. MPPS_SeekFinish = 6,
  34. };
  35. #define MusicPlayerPlayStatus int
  36. enum VideoPlayerPlayStatus {
  37. VPPS_Undefine = -1,
  38. VPPS_Start = 0,
  39. VPPS_Unsupport = 1,
  40. VPPS_Stop = 2,
  41. VPPS_Pause = 3,
  42. VPPS_SuspendToggle = 4,
  43. VPPS_Play = 5,
  44. VPPS_Exit = 6,
  45. VPPS_SeekFinish = 7,
  46. VPPS_UndragAndDrop = 8,
  47. VPPS_PlayError = 9,
  48. };
  49. #define VideoPlayerPlayStatus int
  50. enum VideoPlayerPlayMode {
  51. VPPM_AllRepeat = 0,
  52. VPPM_Shuffle = 1,
  53. VPPM_RepeatOnce = 2,
  54. };
  55. #define VideoPlayerPlayMode int
  56. enum MultimediaType {
  57. MT_Undefine = -1,
  58. MT_Idle = 0,
  59. MT_Music = 1,
  60. MT_Image = 2,
  61. MT_Video = 3,
  62. };
  63. #define MultimediaType int
  64. class MultimediaPersistent
  65. {
  66. Q_DISABLE_COPY(MultimediaPersistent)
  67. public:
  68. static int getMultimediaType(const int deviceWatcherType, const bool reload = true);
  69. // static int getMultimediaType(const DeviceWatcherType distType, const MultimediaType multimediaType, const bool reload = true);
  70. static int getMusicMillesmial(const int type, const bool reload = true);
  71. // static int getMusicMillesmial(const DeviceWatcherType type, const bool reload = true);
  72. static QString getMusicPathInfo(const int type, const bool reload = true);
  73. // static QString getMusicPath(const DeviceWatcherType type, const bool reload = true);
  74. static QString getImagePathInfo(const int type, const bool reload = true);
  75. // static QString getImagePath(const DeviceWatcherType type, const bool reload = true);
  76. static int getVideoMillesmial(const int type, const bool reload = true);
  77. // static int getVideoMillesmial(const DeviceWatcherType type, const bool reload = true);
  78. static QString getVideoPathInfo(const int type, const bool reload = true);
  79. // static QString getVideoPathInfo(const DeviceWatcherType type, const bool reload = true);
  80. protected:
  81. friend class MultimediaService;
  82. friend class MusicPlayerPrivate;
  83. friend class ImagePlayerPrivate;
  84. friend class VideoPlayerPrivate;
  85. friend class MusicPlayer;
  86. friend class VideoPlayer;
  87. static void setMultimediaType(const int deviceWatcherType, const int multimediaType);
  88. // static void setUSBMultimediaType(const DeviceWatcherType distType, const MultimediaType multimediaType);
  89. static void setMusicMillesmial(const int type, const int millesmial);
  90. // static void setMusicMillesmial(const DeviceWatcherType type, const int millesmial);
  91. static void setMusicPathInfo(const int type, const QString& pathpathInfo);
  92. // static void setMusicPathInfo(const DeviceWatcherType type, const QString& pathInfo);
  93. static void setImagePathInfo(const int type, const QString& pathpathInfo);
  94. // static void setImagePathInfo(const DeviceWatcherType type, const QString& pathInfo);
  95. static void setVideoMillesmial(const int type, const int millesmial);
  96. // static void setVideoMillesmial(const DeviceWatcherType type, const int millesmial);
  97. static void setVideoPathInfo(const int type, const QString& pathInfo);
  98. // static void setVideoPathInfo(const DeviceWatcherType type, const QString& pathInfo);
  99. static void reset();
  100. };
  101. #endif // MULTIMEDIAPERSISTENT_H