-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
53 lines (41 loc) · 1.04 KB
/
player.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
#ifndef PLAYER_H
#define PLAYER_H
#include <cmath>
#include <QObject>
#include <QMediaPlayer>
#include <QMediaMetaData>
#include <QLabel>
#include <QCoreApplication>
class MainWindow;
class Player : public QObject
{
Q_OBJECT
public:
Player();
~Player();
void Setup(MainWindow* main_window, int player_index);
QMediaPlayer* GetMediaPlayer();
void PrepareFlipTo(QUrl url);
void FlipFrom(bool was_playing);
void FlipTo(bool was_playing);
void Play();
void Pause();
void SetPosition();
public slots:
// Slots for media events
void OnMediaStatusChange(QMediaPlayer::MediaStatus status);
void OnDurationChange(qint64 new_duration);
void OnPositionChanged(qint64 new_position);
void OnStateChanged(QMediaPlayer::State state);
private:
MainWindow* main_window;
QMediaPlayer* player;
int player_index;
bool is_active;
bool media_interupts_enabled;
bool media_loaded;
bool media_buffered;
qint64 track_duration;
void PrintDebug(QString debug);
};
#endif // PLAYER_H