X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=playlist.h;h=7d3c215d5ab95b055477d3b34d3cc139715ee929;hb=HEAD;hp=d33386b3fa38cdc15908f2c21c4f5729d65ac33e;hpb=c1ea8a35f5d845999c3ba212f3e09e101cf7721a;p=groove diff --git a/playlist.h b/playlist.h index d33386b..7d3c215 100644 --- a/playlist.h +++ b/playlist.h @@ -3,21 +3,87 @@ #include #include - +#include +#include +#include +#include +#include class playlist : public QObject { Q_OBJECT public: + enum elementType + { + EStream = 1, + EFile = 2, + }; + enum failType + { + none = 0, + Aborted = 1, + Other =2 + }; + struct songElement + { + QString *songId; + QString *streamkey; + QUrl *server; + QBuffer *buffer; + QIODevice *data; + elementType type; + bool downloaded; + bool played; + bool bufferready; + }; + QList* getList(); explicit playlist(QObject *parent = 0); - void addSong(QStandardItem item); + int addSong(QStandardItem *item); QList getPlaylist(); void removeSong(int position); - + void getSong(int position); + QIODevice * getBuffer(int position); + bool isStream(int position); + void markPlayed(int position); + void deleteSong(int position); + void setGscom(gscom *comm); + void freeMemory(int position); + int currentplaying(); + void setCurrentPlaying(int position); + bool bReady(int b); + int findFirstNotPlayed(); + void beginDownload(int position); + bool existAt(int position); signals: + void downloadProgress(int position, qint64 d, qint64 t); + void bufferReady(int position); + void sFailure(int position,failType); + void downloadComplete(int position); + void freeze(bool); public slots: +private slots: + void downloadSlot(qint64 d, qint64 t); + void networkReplyFinish(); + void downloadDone(int position); + void skeyFound(); + void setBufferRdy(int b); + void getNError(QNetworkReply::NetworkError); +private: + + + + + int currentplayingitem; + int currentSkeyItem; + QList *pList; + QSignalMapper *mapper; + QNetworkReply *reply; + QNetworkAccessManager *manager; + int currentdownloaditem; + gscom *gs; + QTime startStreamT; }; #endif // PLAYLIST_H