blob: d7e2df6dddeed52c1accaf8af159d7327c643b31 (
plain)
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
#ifndef BANSHEEDBCONNECTION_H
#define BANSHEEDBCONNECTION_H
#include <QSqlDatabase>
#include <QUrl>
class BansheeDbConnection
{
public:
struct Playlist {
QString playlistId;
QString name;
};
struct Track {
QString title;
QUrl uri;
int duration;
int year;
int rating;
QString genre;
QString grouping;
int tracknumber;
int dateadded;
int bpm;
int bitrate;
QString comment;
int playcount;
QString composer;
};
struct Artist {
QString name;
};
struct Album {
QString title;
};
struct PlaylistEntry {
int trackId;
int viewOrder;
struct Track* pTrack;
struct Artist* pArtist;
struct Album* pAlbum;
struct Artist* pAlbumArtist;
};
BansheeDbConnection();
virtual ~BansheeDbConnection();
static QString getDatabaseFile();
bool open(const QString& databaseFile);
int getSchemaVersion();
QList<Playlist> getPlaylists();
QList<PlaylistEntry> getPlaylistEntries(int playlistId);
private:
QSqlDatabase m_database;
QMap<int, Track> m_trackMap;
QMap<int, Artist> m_artistMap;
QMap<int, Album> m_albumMap;
};
#endif // BANSHEEDBCONNECTION_H
|