Sayonara Player
SomaFMLibrary.h
1 /* SomaFMLibrary.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 /* SomaFMLibrary.h */
22 
23 #ifndef SOMAFMLIBRARY_H
24 #define SOMAFMLIBRARY_H
25 
26 #include <QObject>
27 
28 #include "Utils/Pimpl.h"
29 
30 namespace SomaFM
31 {
32  class Station;
33  class Library : public QObject
34  {
35  Q_OBJECT
36 
37  PIMPL(Library)
38 
39  signals:
40  void sig_stations_loaded(const QList<SomaFM::Station>& stations);
41  void sig_station_changed(const SomaFM::Station& station);
42  void sig_loading_finished();
43  void sig_loading_started();
44 
45  public:
46  explicit Library(QObject* parent=nullptr);
47  ~Library();
48 
49  Station station(const QString& name);
50  void create_playlist_from_station(int idx);
51  bool create_playlist_from_playlist(int idx);
52  void search_stations();
53  void set_station_loved(const QString& station_name, bool loved);
54 
55 
56  private slots:
57  void soma_website_fetched();
58  void soma_playlist_content_fetched(bool success);
59  void soma_station_playlists_fetched(bool success);
60 
61  private:
62  void sort_stations(QList<Station>& stations);
63  };
64 }
65 
66 #endif // SOMAFMLIBRARY_H
Definition: SomaFMLibrary.h:30
Definition: SomaFMStation.h:40
An interface class needed when implementing a library plugin.
Definition: CachingThread.h:29
Definition: org_mpris_media_player2_adaptor.h:20