Sayonara Player
Loading...
Searching...
No Matches
GUI_StationSearcher.h
1/* GUI_StationSearcher.h */
2
3/* Copyright (C) 2011-2024 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#ifndef GUISTATIONSEARCHER_H
22#define GUISTATIONSEARCHER_H
23
24#include "Gui/Utils/Widgets/Dialog.h"
25#include "Components/Streaming/StationSearcher/StationSearcher.h"
26#include "Utils/Pimpl.h"
27
29
31class GUI_StationSearcher :
32 public Gui::Dialog
33{
34 Q_OBJECT
35 PIMPL(GUI_StationSearcher)
36 UI_CLASS_SHARED_PTR(GUI_StationSearcher)
37
38 signals:
39 void sigStreamSelected(const QString& name, const QString& url, bool save);
40
41 public:
42 explicit GUI_StationSearcher(const std::shared_ptr<StationSearcherHandler>& stationSearcherHandler,
43 QWidget* parent = nullptr);
44 ~GUI_StationSearcher() override;
45
46 protected:
47 void showEvent(QShowEvent* e) override;
48 void closeEvent(QCloseEvent* e) override;
49
50 void languageChanged() override;
51 void skinChanged() override;
52
53 private slots:
54 void searchClicked();
55 void searchPreviousClicked();
56 void searchNextClicked();
57 void listenClicked();
58 void saveAndListenClicked();
59
60 void searchTextChanged(const QString& text);
61 void stationsFetched();
62
63 void currentStationChanged();
64 void currentServiceChanged(const QString& service);
65
66 private: // NOLINT(readability-redundant-access-specifiers)
67 void listen(bool save);
68 void checkListenButtons();
69 void clearStations();
70 void clearStreams();
71 void changeMode(StationSearcher::Mode mode);
72 void setupCoverButton(const RadioStation& station);
73 [[nodiscard]] StationSearcherPtr currentSearcher() const;
74};
75
76#endif // STATIONSEARCHER_H
Definition GUI_StationSearcher.h:33
Dialog with Settings connection. Also contains triggers for language_changed() and skin_changed()....
Definition Dialog.h:37
Definition StationSearcherHandler.h:30
Definition RadioStation.h:36