Sayonara Player
Artist.h
1 /* Artist.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 _ARTIST_H_
24 #define _ARTIST_H_
25 
26 #include "Helper/MetaData/LibraryItem.h"
27 
28 #include <QVariant>
29 #include <QMetaType>
30 #include <QVector>
31 
36 class Artist : public LibraryItem {
37 
38 public:
39 
40  qint32 id;
41  QString name;
42  quint16 num_songs;
43  quint16 num_albums;
44  QString mb_id;
45 
46  Artist();
47  Artist(const Artist& other);
48  Artist(Artist&& other);
49  Artist& operator=(const Artist& other);
50  virtual ~Artist();
51 
52  static bool fromVariant(const QVariant& v, Artist& a);
53  static QVariant toVariant(const Artist& a);
54  void print() const ;
55 };
56 
57 
58 Q_DECLARE_METATYPE(Artist)
59 
60 
64 class ArtistList :
65  public QVector<Artist>
66 {
67 
68 
69 public:
70 
76  static QString get_major_artist(const QStringList& artists);
77 
83  QString get_major_artist() const;
84 
85 
86  bool contains(int artist_id) const;
87 
88 };
89 
90 
91 #endif
The LibraryItem class.
Definition: LibraryItem.h:59
ArtistList.
Definition: Artist.h:64
The Artist class.
Definition: Artist.h:36