Fixed bug with order of queued tracks and prev-historied tracks
[someplayer] / src / track.h
index 36c2278..7539f21 100644 (file)
@@ -3,25 +3,40 @@
 
 #include "someplayer.h"
 #include "trackmetainformation.h"
-#include <QUrl>
+#include "tagresolver.h"
 
 // represents some track: metainformation + source url
 
 namespace SomePlayer {
        namespace DataObjects {
 
-               class Track
+               class Track : public QObject
                {
+                       Q_OBJECT
+
                public:
                        Track();
-                       Track(TrackMetadata metadata, QUrl source);
-                       TrackMetadata metadata(); //read-write
-                       QUrl source() const;
-                       void setSource (QUrl source);
+                       Track(const Track &track);
+                       Track(int id, TrackMetadata metadata, QString source);
+                       Track(QString source);
+                       ~Track();
+                       Track &operator=(const Track &track);
+                       TrackMetadata metadata() const; //read-write
+                       QString source() const;
+                       int id() const;
+                       void setSource (QString source);
+                       int count() const; //count of plays
+                       void setCount(int count); //for restoring from database and counting from player
+                       bool operator == (const Track &track);
 
                private:
                        TrackMetadata _metadata;
-                       QUrl _source;
+                       QString _source;
+                       int _count;
+                       int _id;
+                       TagResolver *_resolver;
+               private slots:
+                       void decoded(Track);
                };
 
        };