-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplayer.h
38 lines (27 loc) · 839 Bytes
/
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
#ifndef PLAYER_H
#define PLAYER_H
#include <QString>
#include <QObject>
#include <QProcess>
class Player : public QObject
{
Q_OBJECT
public:
Player(QObject* parent = 0);
~Player();
void play(const QString& url);
void stopPlaying();
Q_SIGNALS:
void song(const QString& url);
private Q_SLOTS:
void processMplayerOutput();
private:
// calls start() method from m_player
void startAndLog(const QString& programName, const QStringList& arguments);
// calls QProcess::execute
static void executeAndLog(const QString& programName, const QStringList& arguments);
static QString argumentsToString(const QStringList& arguments);
static QString findRegularExpression(const QStringList ®Exps, const QString& mplayerOutput);
QScopedPointer<QProcess> m_player;
};
#endif // PLAYER_H