Blame view

PlayerControls.h 1.05 KB
3f2992b2c   bostx   V1.0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
  #ifndef PLAYERCONTROLS_H
  #define PLAYERCONTROLS_H
  
  #include <QWidget>
  #include <QToolButton>
  #include <QMediaPlayer>
  #include <QLabel>
  #include <QSlider>
  #include <QComboBox>
  
  class PlayerControls: public QWidget
  {
    Q_OBJECT
  
      public:
    PlayerControls(QWidget *parent = 0);
    ~PlayerControls();
    void reset();
    
    public slots:
    void durationChanged(qint64 duration);
    void positionChanged(qint64 position);
    void mediaStatusChanged(QMediaPlayer::MediaStatus status);
    void playClicked();
  
   signals:
    void play();
    void pause();
    void stop();
    void setMuted(bool muted);
    void positionManuallyChanged(qint64 value);
    void playbackRateChanged(qreal rate);
  
    private slots:
    
    void stopClicked();
    void switchMuted();
    void sliderMoved(int value);
    void rateChanged(const QString &rate);
  
   private:
    QToolButton *m_playButton;
    QToolButton *m_muteButton;
    QMediaPlayer::State playerState;
    bool m_isMuted;
    QLabel *m_currentTimeLabel;
    QLabel *m_durationLabel;
    QSlider *m_durationSlider;
    QComboBox *m_rateBox;
    QString m_timeFormat;
  };
  
  #endif