PlayWidget.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #include <QComboBox>
  3. #include <QHBoxLayout>
  4. #include <QLabel>
  5. #include <QPushButton>
  6. #include <QSlider>
  7. #include <QVBoxLayout>
  8. #include <QWidget>
  9. class PlayerController;
  10. class AudioEffectGL;
  11. class OpenGLVideoWidget;
  12. class PlayWidget : public QWidget
  13. {
  14. Q_OBJECT
  15. public:
  16. explicit PlayWidget(QWidget* parent = nullptr);
  17. ~PlayWidget();
  18. void startToPlay(const QString& url);
  19. bool isPlaying() const;
  20. private:
  21. std::unique_ptr<OpenGLVideoWidget> m_videoWidget;
  22. QSlider* m_sliderProgress;
  23. QLabel* m_labelTime;
  24. QPushButton* m_btnPlayPause;
  25. QComboBox* m_comboSpeed;
  26. QSlider* m_sliderVolume;
  27. QLabel* m_labelVolume;
  28. std::unique_ptr<AudioEffectGL> m_audioEffect;
  29. PlayerController* m_playerController = nullptr;
  30. void setupUi();
  31. void setupConnections();
  32. void setPlayerController(PlayerController* controller);
  33. private slots:
  34. void onPlayPauseClicked();
  35. void onProgressChanged(int value);
  36. void onSpeedChanged(int index);
  37. void onVolumeChanged(int value);
  38. };