PlayerFlat
 Tudo Classes Funções
abstractcontrol.h
1 #ifndef ABSTRACTCONTROL_H
2 #define ABSTRACTCONTROL_H
3 
4 #include <QWidget>
5 
6 // this is the abstract class to implement audio controls
7 class AbstractControl : public QWidget{
8 private:
9  Q_OBJECT
10 public:
11  // constructor does nothing
12  explicit AbstractControl(QWidget *parent = 0){Q_UNUSED(parent)}
13 
14 public slots:
15  // listen when mainwindow tells user pressed play/pause button
16  virtual void onPlayPauseClicked(void)=0;
17 
18  // listen when mainwindow tells user pressed prev button
19  virtual void onPrevClicked(void)=0;
20 
21  // listen when mainwindow tells user pressed next button
22  virtual void onNextClicked(void)=0;
23 
24  // someone changed the volume somewhere
25  virtual void onVolumeChanged(int)=0;
26 
27  // elapsed time has changed somewhere
28  virtual void onElapsedChanged(qint64)=0;
29 
30  // void myElapsedChanged(int)=0;
31  virtual void onDurationChanged(qint64)=0;
32 
33 signals:
34  // tells when user pressed play/pause button
35  void playPause();
36 
37  // tells when user pressed next button
38  void next();
39 
40  // tells when user pressed prevp button
41  void prev();
42 
43  // tells when user pressed stop button
44  void stop();
45 
46  // tells when user changed volume
47  void volumeSelected(int);
48 
49  // tells when user change music position
50  void elapsedSelected(qint64);
51 };
52 
53 #endif // ABSTRACTCONTROL_H
Definition: abstractcontrol.h:7