summaryrefslogtreecommitdiff
path: root/database.h
blob: 55cd301ee92f242b73f9f7245b39ddf74379c6b2 (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
69
70
71
72
73
#ifndef DATABASE_H
#define DATABASE_H

#include <QtCore>
#include <QtSql>

class Artist {
	private:
		int _id;
		QString _name;
	
	public:
		typedef QSharedPointer<Artist> p;
		static p get(int id);
		
		QString name();
		
		QUrl url();
};

class Album {
	private:
		int _id;
		int _artist_id;
		QString _name;
		int _tracks;
	
	public:
		typedef QSharedPointer<Album> p;
		static p get(int id);
		
		QString name();
		Artist::p artist();
		int tracks();
		
		QUrl url();
};

class Track {
	private:
		int _id;
		int _artist_id;
		int _album_id;
		QString _name;
		int _length;
		int _num;
		QString _file_name;
		int _file_index;
	
	public:
		typedef QSharedPointer<Track> p;
		static p get(int id);
		
		QString name();
		Artist::p artist();
		Album::p album();
		int length();
		int num();
		QString file_name();
		int file_index();
		
		QUrl url();
};

class Database {
	private:
		QSqlDatabase db;
		
	public:
		Database();
};

#endif