Add portrait support, download progress
[groove] / splayer.h
1 #ifndef SPLAYER_H
2 #define SPLAYER_H
3 #include <QtNetwork>
4 //#include <parser.h>
5 #include <QObject>
6 #include <phonon>
7 #include "streamio.h"
8 #include <QProgressDialog>
9
10 class sPlayer : public QObject
11 {
12     Q_OBJECT
13 public:
14     explicit sPlayer(QObject *parent = 0);
15     void play(QString StreamKey, QUrl server);
16     void stop();
17     ~sPlayer();
18
19 signals:
20     void finishedPlaying();
21     void downloadComplete();
22 public slots:
23     void start();
24     void putb(qint64,qint64);
25     void abortDownload();
26 private:
27     QNetworkAccessManager *manager;
28     Phonon::AudioOutput *audioOutput;
29     Phonon::MediaObject *media;
30     QNetworkReply *reply;
31     QBuffer *buffer;
32     Phonon::Path *path;
33     bool playing;
34     QObject *internal;
35     QTime startStreamT;
36     QProgressDialog *pd;
37 };
38 #endif // SPLAYER_H