Sayonara Player
Album.h
1 /* Album.h */
2 
3 /* Copyright (C) 2011-2017 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 #ifndef _ALBUM_H_
22 #define _ALBUM_H_
23 
24 #include "Helper/MetaData/LibraryItem.h"
25 
26 #include <QStringList>
27 #include <QMetaType>
28 
29 class QVariant;
30 class Album;
31 
32 Q_DECLARE_METATYPE(Album)
33 
34 
38 class Album :
39  public LibraryItem
40 {
41 
42 private:
43  QStringList _album_artists;
44 
45 public:
46  QString name;
47  qint32 id;
48  quint16 num_songs;
49  quint32 length_sec;
50  quint16 year;
51 
52  QStringList artists;
53 
54  QList<quint8> discnumbers;
55  quint8 n_discs;
56  quint8 rating;
57 
58  bool is_sampler;
59 
60  Album();
61  Album(const Album& other);
62  Album(Album&& other);
63  Album& operator=(const Album& other);
64  ~Album();
65 
66  static QVariant toVariant(const Album& album);
67  static bool fromVariant(const QVariant& v, Album& album);
68 
69  bool has_album_artists() const;
70  QStringList album_artists() const;
71  void set_album_artists(const QStringList& artists);
72 };
73 
74 
79 class AlbumList : public QList<Album>
80 {
81 public:
82  bool contains(qint32 album_id) const;
83 };
84 
85 #endif
86 
87 
The LibraryItem class.
Definition: LibraryItem.h:56
The AlbumList class.
Definition: Album.h:79
The Album class.
Definition: Album.h:38