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  qint32 id;
38  QString name;
39  quint16 num_albums;
40  quint16 num_songs;
41 
42  Artist();
43  Artist(const Artist& other);
44  Artist(Artist&& other);
45  Artist& operator=(const Artist& other);
46  ~Artist();
47 
48  static bool fromVariant(const QVariant& v, Artist& a);
49  static QVariant toVariant(const Artist& a);
50  void print() const ;
51 };
52 
53 
54 Q_DECLARE_METATYPE(Artist)
55 
56 
60 class ArtistList :
61  public QList<Artist>
62 {
63 
64 public:
65 
71  static QString get_major_artist(const QStringList& artists);
72 
78  QString get_major_artist() const;
79 
80 
81  bool contains(int artist_id) const;
82 };
83 
84 #endif
The LibraryItem class.
Definition: LibraryItem.h:56
ArtistList.
Definition: Artist.h:60
The Artist class.
Definition: Artist.h:33
Definition: org_mpris_media_player2_adaptor.h:20