Sayonara Player
LastFM.h
1 /* LastFM.h */
2 
3 /* Copyright (C) 2011-2020 Michael Lugmair (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  * LastFM.h
24  *
25  * Created on: Apr 19, 2011
26  * Author: Michael Lugmair (Lucio Carreras)
27  */
28 
29 #ifndef LASTFM_H_
30 #define LASTFM_H_
31 
32 #include "Utils/Pimpl.h"
33 
34 #include <QObject>
35 
36 class PlayManager;
37 
38 // singleton base LastFM API class
39 // signals and slots are handled by the adapter class
40 namespace LastFM
41 {
42  class Base :
43  public QObject
44  {
45  Q_OBJECT
46  PIMPL(Base)
47 
48  signals:
49  void sigLoggedIn(bool);
50 
51  public:
52  Base(PlayManager* playManager);
53  virtual ~Base();
54 
55  void login(const QString& username, const QString& password);
56  bool isLoggedIn();
57 
58  private:
59  bool initTrackChangeThread();
60  void getSimilarArtists(const QString& artist);
61  bool updateTrack(const MetaData& md);
62 
63  private slots:
64  void activeChanged();
65  void loginThreadFinished(bool success);
66  //void similarArtistsFetched(const IdList& playlistTrack);
67  void currentTrackChanged(const MetaData& track);
68 
69  void scrobble();
70  void scrobbleResponseReceived(const QByteArray& data);
71  void scrobbleErrorReceived(const QString& str);
72 
73  void trackChangedTimerTimedOut();
74  };
75 }
76 
77 #endif /* LASTFM_H_ */
PlayManager
Global handler for current playback state (Singleton)
Definition: PlayManager.h:36
LastFM::Base
Definition: LastFM.h:44
MetaData
The MetaData class.
Definition: MetaData.h:47