PlayWidget.h 1.1 KB

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