Sayonara Player
LFMTrackChangedThread.h
1 /* LFMTrackChangedThread.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  * created by Lucio Carreras,
21  * Jul 18, 2012
22  *
23  */
24 
25 #ifndef LFMTRACKCHANGEDTHREAD_H_
26 #define LFMTRACKCHANGEDTHREAD_H_
27 
28 #include "ArtistMatch.h"
29 #include "Utils/MetaData/MetaDataFwd.h"
30 #include "Utils/Pimpl.h"
31 
32 #include <QObject>
33 
34 class SmartCompare;
35 
36 namespace LastFM
37 {
39  public QObject
40  {
41  Q_OBJECT
42  PIMPL(TrackChangedThread)
43 
44  signals:
45  void sig_similar_artists_available(const IdList& artist_ids);
46 
47 
48  public:
49  explicit TrackChangedThread(QObject* parent=nullptr);
51 
52  void search_similar_artists(const MetaData& md);
53  void update_now_playing(const QString& session_key, const MetaData& md);
54 
55 
56  private:
57  void evaluate_artist_match(const ArtistMatch& artist_match);
58 
59  QMap<QString, int> filter_available_artists(const ArtistMatch& artist_match, ArtistMatch::Quality quality);
60 
61 
62  private slots:
63  void response_sim_artists(const QByteArray& data);
64  void error_sim_artists(const QString& error);
65 
66  void response_update(const QByteArray& response);
67  void error_update(const QString& error);
68  };
69 }
70 #endif /* LFMTRACKCHANGEDTHREAD_H_ */
The MetaData class.
Definition: MetaData.h:48
Definition: ArtistMatch.h:30
Definition: LFMTrackChangedThread.h:38
Definition: org_mpris_media_player2_adaptor.h:21
Definition: org_mpris_media_player2_adaptor.h:20
Quality
The Quality enum used to access the bin of interest. See ArtistMatch::get(Quality q)
Definition: ArtistMatch.h:53