This repository was archived by the owner on May 1, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathabstractcontrol.h
More file actions
58 lines (42 loc) · 1.34 KB
/
abstractcontrol.h
File metadata and controls
58 lines (42 loc) · 1.34 KB
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
54
55
56
57
58
#ifndef ABSTRACTCONTROL_H
#define ABSTRACTCONTROL_H
#include <QWidget>
// this is the abstract class to implement audio controls
class AbstractControl : public QWidget{
private:
Q_OBJECT
public:
// constructor does nothing
explicit AbstractControl(QWidget *parent){
Q_UNUSED(parent);
}
public slots:
// listen when mainwindow tells user pressed play/pause button
virtual void onPlayPauseClicked(void)=0;
// listen when mainwindow tells user pressed prev button
virtual void onPrevClicked(void)=0;
// listen when mainwindow tells user pressed next button
virtual void onNextClicked(void)=0;
// someone changed the volume somewhere
virtual void onVolumeChanged(int)=0;
// elapsed time has changed somewhere
virtual void onElapsedChanged(qint64)=0;
// song duration has changed;
virtual void onDurationChanged(qint64)=0;
// deals with play/pause player state
virtual void onPlayerStateChanged(bool)=0;
signals:
// tells when user pressed play/pause button
void playPause();
// tells when user pressed next button
void next();
// tells when user pressed prevp button
void prev();
// tells when user pressed stop button
void stop();
// tells when user changed volume
void volumeSelected(int);
// tells when user change music position
void elapsedSelected(qint64);
};
#endif // ABSTRACTCONTROL_H