-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmpgplayer.h
56 lines (50 loc) · 1.14 KB
/
mpgplayer.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
#ifndef MPGPLAYER_H
#define MPGPLAYER_H
#include <QtNetwork>
//#include <parser.h>
#include <QObject>
#include "streamio.h"
#include <QProgressDialog>
#include "grooveprogressbar.h"
#include "playlist.h"
#include <mpg123.h>
class mpgplayer : public QThread
{
Q_OBJECT
public:
explicit mpgplayer(QObject *parent = 0);
void play(int p);
void run();
void play();
void stop();
void pause();
void setPlaylist(playlist *playList);
~mpgplayer();
signals:
void finishedPlaying();
void downloadComplete();
public slots:
void playNext();
void putb(int p,qint64,qint64);
void abortDownload();
void back();
private slots:
void markComplete();
void updatePlayPosition(qint64 time);
private:
enum status {TWait, TAbort, TFinish, TData};
status net;
QNetworkAccessManager *manager;
Phonon::AudioOutput *audioOutput;
Phonon::MediaObject *media;
QNetworkReply *reply;
QBuffer *buffer;
Phonon::Path *path;
bool playing;
QObject *internal;
QTime startStreamT;
grooveProgressBar *pd;
playlist *pl;
static const long samplerate = 44100;
};
#endif // MPGPLAYER_H