-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplaylist.h
More file actions
43 lines (34 loc) · 1.01 KB
/
playlist.h
File metadata and controls
43 lines (34 loc) · 1.01 KB
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
#ifndef QMUSICPLAYER_PLAYLIST_H
#define QMUSICPLAYER_PLAYLIST_H
#include <QString>
#include <QList>
#include <QFileInfo>
#include <taglib/fileref.h>
#include <taglib/tag.h>
#include <taglib/flacfile.h>
class Playlist {
public:
Playlist() = default;
Playlist(const Playlist& playlist);
// 歌曲结构体
struct Song {
QString title;
QString artist;
QString album;
QString path;
};
const uint addSongToList(const Song& song);
void removeSongByIndex(const uint index);
void removeSongByPath(const QString& path);
void clearPlaylist();
const QList<Song> getPlayList() const;
const Song getSongByIndex(const uint index);
const Song getSongByPath(const QString& path);
const uint findSongByPath(const QString& path);
const uint getSongCount() const;
bool parseSongFromFileName(const QString& path, Song &song);
bool swap(const uint index1, const uint index2);
private:
QList<Song> play_list;
};
#endif //QMUSICPLAYER_PLAYLIST_H