Sayonara Player
Artist.h
1 /* Artist.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 _ARTIST_H_
22 #define _ARTIST_H_
23 
24 #include "Helper/MetaData/LibraryItem.h"
25 
26 #include <QStringList>
27 #include <QMetaType>
28 
33 class Artist :
34  public LibraryItem
35 {
36 public:
37 
38  qint32 id;
39  QString name;
40  quint16 num_songs;
41  quint16 num_albums;
42  //QString mb_id;
43 
44  Artist();
45  Artist(const Artist& other);
46  Artist(Artist&& other);
47  Artist& operator=(const Artist& other);
48  ~Artist();
49 
50  static bool fromVariant(const QVariant& v, Artist& a);
51  static QVariant toVariant(const Artist& a);
52  void print() const ;
53 };
54 
55 
56 Q_DECLARE_METATYPE(Artist)
57 
58 
62 class ArtistList :
63  public QList<Artist>
64 {
65 
66 public:
67 
73  static QString get_major_artist(const QStringList& artists);
74 
80  QString get_major_artist() const;
81 
82 
83  bool contains(int artist_id) const;
84 };
85 
86 #endif
The LibraryItem class.
Definition: LibraryItem.h:56
ArtistList.
Definition: Artist.h:62
The Artist class.
Definition: Artist.h:33
Definition: org_mpris_media_player2_adaptor.h:20