videoplayer.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * 叶海辉
  3. * QQ群121376426
  4. * http://blog.yundiantech.com/
  5. */
  6. #ifndef VIDEOPLAYER_H
  7. #define VIDEOPLAYER_H
  8. #include <QWidget>
  9. #include <customtitle.h>
  10. #include <QImage>
  11. #include <QPaintEvent>
  12. #include <QTimer>
  13. #include <QPushButton>
  14. #include "videoplayer/videoplayer_thread.h"
  15. namespace Ui {
  16. class VideoPlayer;
  17. }
  18. ///这个是播放器的主界面 包括那些按钮和进度条之类的
  19. class VideoPlayer : public CustomTitle
  20. {
  21. Q_OBJECT
  22. public:
  23. explicit VideoPlayer(QWidget *parent = 0);
  24. ~VideoPlayer();
  25. protected:
  26. void doClose();
  27. // void mousePressEvent(QMouseEvent *e);
  28. // void mouseDoubleClickEvent(QMouseEvent *);
  29. private:
  30. Ui::VideoPlayer *ui;
  31. VideoPlayer_Thread *mPlayer; //播放线程
  32. QTimer *mTimer; //定时器-获取当前视频时间
  33. private slots:
  34. ///播放器相关的槽函数
  35. void slotTotalTimeChanged(qint64 uSec);
  36. void slotSliderMoved(int value);
  37. void slotTimerTimeOut();
  38. void slotBtnClick();
  39. void slotStateChanged(VideoPlayer_Thread::PlayerState state);
  40. };
  41. #endif // VIDEOPLAYER_H