Sayonara Player
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Gui
Plugins
Stream
AbstractStationPlugin.h
1
/* GUI_AbstractStream.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 GUI_ABSTRACT_STREAM_H_
22
#define GUI_ABSTRACT_STREAM_H_
23
24
#include "Gui/Plugins/PlayerPluginBase.h"
25
#include "GUI_ConfigureStation.h"
26
#include "Gui/Utils/PreferenceAction.h"
27
#include "Utils/Pimpl.h"
28
#include "Utils/Streams/Station.h"
29
30
class
AbstractStationHandler
;
31
class
QComboBox;
32
class
QPushButton;
33
34
namespace
Playlist
35
{
36
class
Creator
;
37
}
38
39
namespace
Gui
40
{
41
class
MenuToolButton
;
42
43
class
StreamPreferenceAction :
44
public
PreferenceAction
45
{
46
Q_OBJECT
47
48
public
:
49
explicit
StreamPreferenceAction(QWidget* parent);
50
~StreamPreferenceAction()
override
;
51
52
[[nodiscard]] QString identifier()
const override
;
53
54
protected
:
55
[[nodiscard]] QString displayName()
const override
;
56
};
57
58
class
AbstractStationPlugin :
59
public
PlayerPlugin::Base
60
{
61
Q_OBJECT
62
PIMPL(AbstractStationPlugin)
63
64
public
:
65
AbstractStationPlugin(
Playlist::Creator
* playlistCreator,
AbstractStationHandler
* stationHandler,
66
QWidget* parent =
nullptr
);
67
~AbstractStationPlugin()
override
;
68
69
protected
:
70
[[nodiscard]]
virtual
QComboBox* comboStream() = 0;
71
[[nodiscard]]
virtual
QPushButton* btnPlay() = 0;
72
[[nodiscard]]
virtual
MenuToolButton
* btnMenu() = 0;
73
[[nodiscard]]
virtual
QString titleFallbackName()
const
= 0;
74
[[nodiscard]]
virtual
GUI_ConfigureStation
* createConfigDialog() = 0;
75
76
void
initUi
()
override
;
77
void
assignUiVariables()
override
;
78
void
skinChanged()
override
;
79
void
retranslate()
override
;
80
[[nodiscard]]
bool
hasLoadingBar
()
const override
;
81
82
void
createStation(
const
StationPtr& station,
bool
temporary);
83
84
private
slots:
85
void
playStopClicked();
86
void
currentIndexChanged(
int
index);
87
void
newClicked();
88
void
saveClicked();
89
void
editClicked();
90
void
deleteClicked();
91
void
urlCountExceeded(
int
urlCount,
int
maxUrlCount);
92
void
errorReceived();
93
94
private
:
// NOLINT(readability-redundant-access-specifiers)
95
void
showConfigDialog(
const
QString&
name
,
const
StationPtr& station,
96
GUI_ConfigureStation::Mode mode,
97
std::function<
bool
(
GUI_ConfigureStation
*)>&& callback);
98
99
void
initConnections();
100
void
setupStations();
101
void
configureToolButton();
102
void
restorePreviousIndex(
const
QString&
name
);
103
[[nodiscard]] QString currentName()
const
;
104
[[nodiscard]] QString currentUrl()
const
;
105
void
setSearching(
bool
b);
106
void
startPlayback();
107
void
checkPlayStopButton();
108
};
109
}
110
111
#endif
// GUI_ABSTRACT_STREAM_H_
AbstractStationHandler
Definition
AbstractStationHandler.h:39
GUI_ConfigureStation
Definition
GUI_ConfigureStation.h:33
Gui::AbstractStationPlugin::initUi
void initUi() override
GUI will be initialized on first show up. Please use this to make Sayonara starting fast.
Gui::AbstractStationPlugin::hasLoadingBar
bool hasLoadingBar() const override
indicates if the widget has a loading bar. If yes, there will be reserved some extra space at the bot...
Gui::MenuToolButton
Definition
MenuToolButton.h:37
PlayerPlugin::Base
Definition
PlayerPluginBase.h:40
PlayerPlugin::Base::name
virtual QString name() const =0
must be overwritten
Playlist::Creator
Definition
PlaylistInterface.h:59
Generated on
for Sayonara Player by
1.17.0