13#ifndef STREAMS_HLS_TAB_H
14#define STREAMS_HLS_TAB_H
24#include "../ui_toolx.h"
44 explicit HlsTab(Ui::Dialog &ui, QWidget *parent =
nullptr);
70 void fromJson(
const QJsonArray &streams);
95 int insertRow(
const QString &name,
const QString &url);
101 void setState(
int id,
const QString &state);
Ui::Dialog & m_ui
The main dialogue UI.
Definition hls_tab.h:110
void stopSelected()
Close the player of the selected stream.
Definition hls_tab.cpp:191
bool m_loading
Set while the table is being filled so edits are not saved.
Definition hls_tab.h:120
QJsonArray toJson() const
The table as a JSON array for the configuration file.
Definition hls_tab.cpp:91
void fromJson(const QJsonArray &streams)
Replace the table with the streams of a JSON array.
Definition hls_tab.cpp:104
std::map< int, QPointer< HlsPlayer > > m_players
The active players keyed by stream id.
Definition hls_tab.h:114
int insertRow(const QString &name, const QString &url)
Add a row to the table and return its index.
Definition hls_tab.cpp:204
void addStream()
Add an empty stream to the table and start editing its URL.
Definition hls_tab.cpp:125
void setState(int id, const QString &state)
Show the state of a stream.
Definition hls_tab.cpp:240
void load()
Load the saved streams.
Definition hls_tab.cpp:284
void updateButtons()
Enable the buttons that apply to the selected stream and update the count.
Definition hls_tab.cpp:257
int m_next_id
The id given to the next stream.
Definition hls_tab.h:118
int idOfRow(int row) const
The id of the stream in a row.
Definition hls_tab.cpp:234
void save() const
Save the names and URLs.
Definition hls_tab.cpp:271
int rowOfId(int id) const
Find the row of a stream, -1 if it was removed.
Definition hls_tab.cpp:223
QWidget * m_parent
Parent widget for player windows.
Definition hls_tab.h:112
HlsTab(Ui::Dialog &ui, QWidget *parent=nullptr)
Construct a new HLS tab and wire up the widgets.
Definition hls_tab.cpp:47
TabIndicator m_indicator
Red dot on the tab header, visible while any stream is playing.
Definition hls_tab.h:116
~HlsTab() final
Stop all the players.
Definition hls_tab.cpp:80
void playSelected()
Open a player for the selected stream.
Definition hls_tab.cpp:155
void removeSelected()
Stop and remove the selected stream.
Definition hls_tab.cpp:136
Shows a red dot on the right of a tab header while something is running.
Definition tab_indicator.h:31
Video player window for HLS (HTTP Live Streaming) streams.
A small red dot on the right of a tab header, shown while streams are running.