Add readme
[groove] / mpgplayer.h
1 #ifndef MPGPLAYER_H
2 #define MPGPLAYER_H
3
4 #include <QtNetwork>
5 //#include <parser.h>
6 #include <QObject>
7 #include "streamio.h"
8 #include <QProgressDialog>
9 #include "grooveprogressbar.h"
10 #include "playlist.h"
11 #include <mpg123.h>
12
13 class mpgplayer : public QThread
14 {
15     Q_OBJECT
16 public:
17     explicit mpgplayer(QObject *parent = 0);
18     void play(int p);
19     void run();
20
21     void play();
22     void stop();
23     void pause();
24     void setPlaylist(playlist *playList);
25     ~mpgplayer();
26
27 signals:
28     void finishedPlaying();
29     void downloadComplete();
30 public slots:
31     void playNext();
32     void putb(int p,qint64,qint64);
33     void abortDownload();
34     void back();
35 private slots:
36     void markComplete();
37     void updatePlayPosition(qint64 time);
38 private:
39     enum status {TWait, TAbort, TFinish, TData};
40     status net;
41     QNetworkAccessManager *manager;
42     Phonon::AudioOutput *audioOutput;
43     Phonon::MediaObject *media;
44     QNetworkReply *reply;
45     QBuffer *buffer;
46     Phonon::Path *path;
47     bool playing;
48     QObject *internal;
49     QTime startStreamT;
50     grooveProgressBar *pd;
51     playlist *pl;
52     static const long samplerate = 44100;
53
54 };
55
56 #endif // MPGPLAYER_H