Sayonara Player
Album.h
1 /* Album.h */
2 
3 /* Copyright (C) 2011-2016 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 
22 
23 #ifndef _ALBUM_H_
24 #define _ALBUM_H_
25 
26 #include "Helper/MetaData/LibraryItem.h"
27 
28 #include <QStringList>
29 #include <QVariant>
30 #include <QMetaType>
31 #include <QVector>
32 
33 class Album;
34 
35 Q_DECLARE_METATYPE(Album)
36 
37 
41 class Album : public LibraryItem {
42 
43 public:
44  QString name;
45  qint32 id;
46  quint16 num_songs;
47  quint32 length_sec;
48  quint16 year;
49  QStringList artists;
50  QList<quint8> discnumbers;
51  quint8 n_discs;
52  quint8 rating;
53  QString mb_id;
54 
55  bool is_sampler;
56 
57  Album();
58  Album(const Album& other);
59  Album(Album&& other);
60  Album& operator=(const Album& other);
61  virtual ~Album();
62 
63  static QVariant toVariant(const Album& album);
64  static bool fromVariant(const QVariant& v, Album& album);
65  void print() const;
66 };
67 
68 
73 class AlbumList : public QVector<Album> {
74 
75 public:
76  bool contains(qint32 album_id) const;
77 };
78 
79 #endif
80 
81 
The LibraryItem class.
Definition: LibraryItem.h:59
The AlbumList class.
Definition: Album.h:73
The Album class.
Definition: Album.h:41