ToolX 1.11.1 [e3f477f]
A GUI debug tool chain for diagnosing GVA systems
Loading...
Searching...
No Matches
HlsTab Class Reference

Manages the list of HLS streams and their player windows. More...

#include <hls_tab.h>

Inheritance diagram for HlsTab:
Inheritance graph
Collaboration diagram for HlsTab:
Collaboration graph

Public Slots

void addStream ()
 Add an empty stream to the table and start editing its URL.
void removeSelected ()
 Stop and remove the selected stream.
void playSelected ()
 Open a player for the selected stream.
void stopSelected ()
 Close the player of the selected stream.

Public Member Functions

 HlsTab (Ui::Dialog &ui, QWidget *parent=nullptr)
 Construct a new HLS tab and wire up the widgets.
 ~HlsTab () final
 Stop all the players.
 HlsTab (const HlsTab &)=delete
HlsTab & operator= (const HlsTab &)=delete
 HlsTab (HlsTab &&)=delete
HlsTab & operator= (HlsTab &&)=delete
QJsonArray toJson () const
 The table as a JSON array for the configuration file.
void fromJson (const QJsonArray &streams)
 Replace the table with the streams of a JSON array.

Private Member Functions

int insertRow (const QString &name, const QString &url)
 Add a row to the table and return its index.
int rowOfId (int id) const
 Find the row of a stream, -1 if it was removed.
int idOfRow (int row) const
 The id of the stream in a row.
void setState (int id, const QString &state)
 Show the state of a stream.
void updateButtons ()
 Enable the buttons that apply to the selected stream and update the count.
void save () const
 Save the names and URLs.
void load ()
 Load the saved streams.

Private Attributes

Ui::Dialog & m_ui
 The main dialogue UI.
QWidget * m_parent
 Parent widget for player windows.
std::map< int, QPointer< HlsPlayer > > m_players
 The active players keyed by stream id.
TabIndicator m_indicator
 Red dot on the tab header, visible while any stream is playing.
int m_next_id = 1
 The id given to the next stream.
bool m_loading = false
 Set while the table is being filled so edits are not saved.

Detailed Description

Manages the list of HLS streams and their player windows.

The names and URLs are saved between runs.

Constructor & Destructor Documentation

◆ HlsTab()

HlsTab::HlsTab ( Ui::Dialog & ui,
QWidget * parent = nullptr )
explicit

Construct a new HLS tab and wire up the widgets.

Parameters
uithe main dialogue UI
parentthe parent widget for the player windows

Member Function Documentation

◆ fromJson()

void HlsTab::fromJson ( const QJsonArray & streams)

Replace the table with the streams of a JSON array.

The open players are closed and the table is cleared.

Parameters
streamsthe array made by toJson()

◆ toJson()

QJsonArray HlsTab::toJson ( ) const

The table as a JSON array for the configuration file.

Returns
QJsonArray one object per row with the name and the playlist URL

The documentation for this class was generated from the following files: