summaryrefslogtreecommitdiffstats
path: root/qtplaylist.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-10-30 12:03:32 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-10-30 12:03:32 +0100
commitbeb0cc36b4dcbe9cd5de0a3cbb2d2e998eb42d03 (patch)
treead7b969fd8905611e44d344ddb203d75d47d4e46 /qtplaylist.h
parent2dcbb6e5867529270e6cae985a8c5c7005a77f9b (diff)
Try to separate out ownership of tracks into its own
class. We can't separate out ownership of playlists, as only the root playlist can be owned.
Diffstat (limited to 'qtplaylist.h')
-rw-r--r--qtplaylist.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/qtplaylist.h b/qtplaylist.h
new file mode 100644
index 0000000..d43ceef
--- /dev/null
+++ b/qtplaylist.h
@@ -0,0 +1,51 @@
+#ifndef QTPLAYLIST_H
+#define QTPLAYLIST_H
+
+#include <QtCore/QObject>
+
+struct despotify_session;
+struct playlist;
+struct track;
+struct search_result;
+struct album_browse;
+struct artist_browse;
+class QtPlaylist: public QObject
+{
+ Q_OBJECT
+public:
+ QtPlaylist(despotify_session *session, QObject *parent = 0);
+ ~QtPlaylist();
+
+ void setArtist(const QByteArray &artistId);
+ void setAlbum(const QByteArray &albumId);
+ void setSearchTerm(const QString &searchTerm);
+ void setPlaylist(playlist *pl);
+ void searchMore();
+
+ QList<track *> tracks() const;
+
+private:
+ void cleanUp();
+ QList<track *> makeList(track *firstTrack) const;
+
+ enum Type {
+ NoType,
+ Playlist,
+ Search,
+ Album,
+ Artist
+ };
+
+ despotify_session *m_session;
+
+ union {
+ playlist *m_playlist;
+ search_result *m_searchResult;
+ album_browse *m_album;
+ artist_browse *m_artist;
+ };
+ Type m_type;
+
+};
+
+#endif // QTPLAYLIST_H