MythTV  master
streamview.h
Go to the documentation of this file.
1 #ifndef STREAMVIEW_H_
2 #define STREAMVIEW_H_
3 
4 // qt
5 #include <QEvent>
6 #include <QVector>
7 #include <QTimer>
8 
9 // myth
10 #include <mythscreentype.h>
11 
12 // mythmusic
13 #include <musiccommon.h>
14 
15 class MythUIText;
16 class MythUIProgressBar;
17 
18 class StreamView : public MusicCommon
19 {
20  Q_OBJECT
21 
22  public:
23  StreamView(MythScreenStack *parent, MythScreenType *parentScreen);
24  ~StreamView(void) override = default;
25 
26  bool Create(void) override; // MythScreenType
27  bool keyPressEvent(QKeyEvent *event) override; // MusicCommon
28 
29  void addStream(MusicMetadata *mdata);
30  void deleteStream(MusicMetadata *mdata);
31  void updateStream(MusicMetadata *mdata);
32 
33  void ShowMenu(void) override; // MusicCommon
34 
35  protected:
36  void customEvent(QEvent *event) override; // MusicCommon
37  void updateStreamList(void);
38  void editStream(void);
39  void removeStream(void);
40 
41  private slots:
43  static void streamItemVisible(MythUIButtonListItem *item);
44  void doRemoveStream(bool ok);
45 
46  private:
48  MythUIText *m_noStreams {nullptr};
51 
54 };
55 
57 {
58  Q_OBJECT
59 
60  public:
62  MusicMetadata *mdata = nullptr)
63  : MythScreenType(parentStack, "editstreampopup"),
64  m_parent(parent), m_streamMeta(mdata) {}
65 
66  bool Create() override; // MythScreenType
68 
69  private slots:
70  void searchClicked(void);
71  void saveClicked(void);
72 
73  private:
74  StreamView *m_parent {nullptr};
75 
77 
91 
95 };
96 
98 {
99  Q_OBJECT
100 
101  public:
103  : MythScreenType(parentStack, "searchstream"), m_parent(parent) {}
104 
105  bool Create() override; // MythScreenType
106 
107  private slots:
108  void doneLoading(void);
109  void updateStreams(void);
110  void doUpdateStreams(void);
112  static void streamVisible(MythUIButtonListItem *item);
113 
114  private:
115  void Load(void) override; // MythScreenType
116  static void loadStreams(void);
117  void updateBroadcasters(void);
118  void updateGenres(void);
119  void updateCountries(void);
120  void updateLanguages(void);
121 
123  QList<MusicMetadata> m_streams;
124  QStringList m_broadcasters;
125  QStringList m_genres;
126 
128  QString m_oldGenre;
129  QString m_oldChannel;
130  QString m_oldCountry;
131  QString m_oldLanguage;
132 
140 
142  bool m_updating {false};
143 };
144 #endif
StreamView::streamItemClicked
void streamItemClicked(MythUIButtonListItem *item)
Definition: streamview.cpp:489
SearchStream::m_oldLanguage
QString m_oldLanguage
Definition: streamview.h:131
StreamView::~StreamView
~StreamView(void) override=default
StreamView::updateStreamList
void updateStreamList(void)
Definition: streamview.cpp:426
StreamView::m_bufferStatus
MythUIText * m_bufferStatus
Definition: streamview.h:49
EditStreamMetadata::m_searchButton
MythUIButton * m_searchButton
Definition: streamview.h:92
SearchStream::doneLoading
void doneLoading(void)
Definition: streamview.cpp:842
EditStreamMetadata::searchClicked
void searchClicked(void)
Definition: streamview.cpp:708
StreamView::Create
bool Create(void) override
Definition: streamview.cpp:39
SearchStream::m_oldCountry
QString m_oldCountry
Definition: streamview.h:130
StreamView::ShowMenu
void ShowMenu(void) override
Definition: streamview.cpp:77
SearchStream::doUpdateStreams
void doUpdateStreams(void)
Definition: streamview.cpp:993
SearchStream
Definition: streamview.h:97
SearchStream::m_genreList
MythUIButtonList * m_genreList
Definition: streamview.h:134
SearchStream::m_oldBroadcaster
QString m_oldBroadcaster
Definition: streamview.h:127
EditStreamMetadata::m_url3Edit
MythUITextEdit * m_url3Edit
Definition: streamview.h:83
SearchStream::updateLanguages
void updateLanguages(void)
Definition: streamview.cpp:958
MythScreenStack
Definition: mythscreenstack.h:16
MythUITextEdit
A text entry and edit widget.
Definition: mythuitextedit.h:32
StreamView::doRemoveStream
void doRemoveStream(bool ok)
Definition: streamview.cpp:411
EditStreamMetadata::m_logourlEdit
MythUITextEdit * m_logourlEdit
Definition: streamview.h:86
MythScreenType
Screen in which all other widgets are contained and rendered.
Definition: mythscreentype.h:44
SearchStream::m_updating
bool m_updating
Definition: streamview.h:142
StreamView::m_bufferProgress
MythUIProgressBar * m_bufferProgress
Definition: streamview.h:50
MusicMetadata
Definition: musicmetadata.h:80
EditStreamMetadata::m_url5Edit
MythUITextEdit * m_url5Edit
Definition: streamview.h:85
SearchStream::updateGenres
void updateGenres(void)
Definition: streamview.cpp:907
SearchStream::streamClicked
void streamClicked(MythUIButtonListItem *item)
Definition: streamview.cpp:851
StreamView::updateStream
void updateStream(MusicMetadata *mdata)
Definition: streamview.cpp:551
EditStreamMetadata::Create
bool Create() override
Definition: streamview.cpp:651
SearchStream::updateCountries
void updateCountries(void)
Definition: streamview.cpp:931
EditStreamMetadata::saveClicked
void saveClicked(void)
Definition: streamview.cpp:720
MythUIButtonListItem
Definition: mythuibuttonlist.h:27
SearchStream::m_countryList
MythUIButtonList * m_countryList
Definition: streamview.h:135
SearchStream::Create
bool Create() override
Definition: streamview.cpp:776
StreamView::m_streamList
MythUIButtonList * m_streamList
Definition: streamview.h:47
EditStreamMetadata::m_formatEdit
MythUITextEdit * m_formatEdit
Definition: streamview.h:87
EditStreamMetadata::m_cancelButton
MythUIButton * m_cancelButton
Definition: streamview.h:93
EditStreamMetadata::m_broadcasterEdit
MythUITextEdit * m_broadcasterEdit
Definition: streamview.h:78
EditStreamMetadata::EditStreamMetadata
EditStreamMetadata(MythScreenStack *parentStack, StreamView *parent, MusicMetadata *mdata=nullptr)
Definition: streamview.h:61
StreamView
Definition: streamview.h:18
MythUIProgressBar
Progress bar widget.
Definition: mythuiprogressbar.h:12
EditStreamMetadata::m_channelEdit
MythUITextEdit * m_channelEdit
Definition: streamview.h:79
StreamView::m_currStream
MusicMetadata * m_currStream
Definition: streamview.h:52
SearchStream::m_channelEdit
MythUITextEdit * m_channelEdit
Definition: streamview.h:137
SearchStream::m_broadcasterList
MythUIButtonList * m_broadcasterList
Definition: streamview.h:133
StreamView::m_lastStream
MusicMetadata * m_lastStream
Definition: streamview.h:53
StreamView::deleteStream
void deleteStream(MusicMetadata *mdata)
Definition: streamview.cpp:623
StreamView::streamItemVisible
static void streamItemVisible(MythUIButtonListItem *item)
Definition: streamview.cpp:497
MythUIButton
A single button widget.
Definition: mythuibutton.h:21
StreamView::addStream
void addStream(MusicMetadata *mdata)
Definition: streamview.cpp:517
SearchStream::m_streamList
MythUIButtonList * m_streamList
Definition: streamview.h:138
SearchStream::m_matchesText
MythUIText * m_matchesText
Definition: streamview.h:139
EditStreamMetadata::m_streamMeta
MusicMetadata * m_streamMeta
Definition: streamview.h:76
EditStreamMetadata::m_descEdit
MythUITextEdit * m_descEdit
Definition: streamview.h:80
EditStreamMetadata::m_languageEdit
MythUITextEdit * m_languageEdit
Definition: streamview.h:90
musiccommon.h
EditStreamMetadata::m_genreEdit
MythUITextEdit * m_genreEdit
Definition: streamview.h:88
SearchStream::updateStreams
void updateStreams(void)
Definition: streamview.cpp:985
SearchStream::updateBroadcasters
void updateBroadcasters(void)
Definition: streamview.cpp:883
SearchStream::m_languageList
MythUIButtonList * m_languageList
Definition: streamview.h:136
SearchStream::m_broadcasters
QStringList m_broadcasters
Definition: streamview.h:124
StreamView::m_noStreams
MythUIText * m_noStreams
Definition: streamview.h:48
MythUIText
All purpose text widget, displays a text string.
Definition: mythuitext.h:30
EditStreamMetadata::changeStreamMetadata
void changeStreamMetadata(MusicMetadata *mdata)
Definition: streamview.cpp:754
StreamView::removeStream
void removeStream(void)
Definition: streamview.cpp:394
SearchStream::m_oldGenre
QString m_oldGenre
Definition: streamview.h:128
SearchStream::m_parent
EditStreamMetadata * m_parent
Definition: streamview.h:122
SearchStream::m_updateTimer
QTimer m_updateTimer
Definition: streamview.h:141
EditStreamMetadata::m_saveButton
MythUIButton * m_saveButton
Definition: streamview.h:94
StreamView::keyPressEvent
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
Definition: streamview.cpp:336
EditStreamMetadata
Definition: streamview.h:56
SearchStream::SearchStream
SearchStream(MythScreenStack *parentStack, EditStreamMetadata *parent)
Definition: streamview.h:102
SearchStream::Load
void Load(void) override
Load data which will ultimately be displayed on-screen or used to determine what appears on-screen (S...
Definition: streamview.cpp:836
SearchStream::streamVisible
static void streamVisible(MythUIButtonListItem *item)
Definition: streamview.cpp:862
SearchStream::loadStreams
static void loadStreams(void)
Definition: streamview.cpp:878
SearchStream::m_streams
QList< MusicMetadata > m_streams
Definition: streamview.h:123
EditStreamMetadata::m_countryEdit
MythUITextEdit * m_countryEdit
Definition: streamview.h:89
SearchStream::m_genres
QStringList m_genres
Definition: streamview.h:125
StreamView::editStream
void editStream(void)
Definition: streamview.cpp:378
EditStreamMetadata::m_url2Edit
MythUITextEdit * m_url2Edit
Definition: streamview.h:82
StreamView::StreamView
StreamView(MythScreenStack *parent, MythScreenType *parentScreen)
Definition: streamview.cpp:33
MythUIButtonList
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
Definition: mythuibuttonlist.h:151
EditStreamMetadata::m_url1Edit
MythUITextEdit * m_url1Edit
Definition: streamview.h:81
SearchStream::m_oldChannel
QString m_oldChannel
Definition: streamview.h:129
EditStreamMetadata::m_url4Edit
MythUITextEdit * m_url4Edit
Definition: streamview.h:84
StreamView::customEvent
void customEvent(QEvent *event) override
Definition: streamview.cpp:103
mythscreentype.h
EditStreamMetadata::m_parent
StreamView * m_parent
Definition: streamview.h:74
MusicCommon
Definition: musiccommon.h:47