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