forked from jjzhang166/music-player
/
Playlist.h
48 lines (36 loc) · 782 Bytes
/
Playlist.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef PLAYLIST_H
#define PLAYLIST_H
#include <QVector>
#include <QObject>
#include "Song.h"
#include <QVector>
#include <QTime>
class Playlist
{
public:
enum Type{
auto_gen,
user_gen,
smart_gen
};
Playlist();
void push_back(Song* song);
QVector<Song* >* list();
QString title();
void setTitle(const QString& title);
void read(const QJsonObject &json);
void write(QJsonObject &json);
void open(QJsonObject& json);
void setType(Type type);
QTime time();
Playlist::Type type();
static QString typeName(Playlist::Type type);
private:
QVector<Song* >* list_;
QString title_;
QTime time_;
Type type_;
QString parseTitle(QString title);
public slots:
};
#endif // PLAYLIST_H