-
Notifications
You must be signed in to change notification settings - Fork 0
/
myplayer.h
86 lines (63 loc) · 1.56 KB
/
myplayer.h
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef MYPLAYER_H
#define MYPLAYER_H
#include "mytitlebar.h"
#include <QMainWindow>
#include <QMediaPlaylist>
#include <QSystemTrayIcon>
class MyMediaPlayer;
class QListWidgetItem;
class QCloseEvent;
class QPoint;
class QAction;
class QMenu;
namespace Ui {
class MyPlayer;
}
class MyPlayer : public QMainWindow
{
Q_OBJECT
public:
explicit MyPlayer(QWidget *parent = 0);
~MyPlayer();
public slots:
void getDuration(qint64);
//volume
void setVolumeLabelValue(int);
void getVolume(int);
void setSliderPostionValue(qint64);
void setPositionLabelValue(qint64);
void addDir();
void searchLocalFiles();
void getPlaybackMode(QMediaPlaylist::PlaybackMode);
void setPlaybackMode();
//titlebar control mainWindow
void moveWindow(const QPoint &point);
void setMainWindowState(MyTitleBar::WindowState state);
void dealWithTrayIconActivated(QSystemTrayIcon::ActivationReason reason);
private:
Ui::MyPlayer *ui;
//player core
MyMediaPlayer *player;
QMediaPlaylist *playList;
void loadMedia();
//media control
qint64 duration;
qint64 position;
int volume;
QMediaPlaylist::PlaybackMode playbackMode = QMediaPlaylist::Loop;
//save player information
void saveCurrentInfo();
//init
void init();
//control window state
void hideWindow();
void closeWindow();
//trayIcon
QAction *showTheWindow;
QAction *exitProgram;
QMenu *trayMenu;
QSystemTrayIcon *trayIcon;
protected:
void closeEvent(QCloseEvent *);
};
#endif // MYPLAYER_H