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 public:
42  quint8 n_discs;
43  quint8 rating;
44  bool is_sampler;
45 
46  qint32 id;
47  quint32 length_sec;
48  quint16 num_songs;
49  quint16 year;
50 
51  QString name;
52  QStringList artists;
53  QList<quint8> discnumbers;
54 
55 private:
56  QStringList _album_artists;
57 
58 public:
59  Album();
60  Album(const Album& other);
61  Album(Album&& other);
62  Album& operator=(const Album& other);
63  ~Album();
64 
65  static QVariant toVariant(const Album& album);
66  static bool fromVariant(const QVariant& v, Album& album);
67 
68  bool has_album_artists() const;
69  QStringList album_artists() const;
70  void set_album_artists(const QStringList& artists);
71 };
72 
73 
78 class AlbumList : public QList<Album>
79 {
80 public:
81  bool contains(qint32 album_id) const;
82 };
83 
84 #endif
85 
86 
The LibraryItem class.
Definition: LibraryItem.h:56
The AlbumList class.
Definition: Album.h:78
The Album class.
Definition: Album.h:38