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

Manages the list of SRT streams to receive and their player windows. More...

#include <srt_receive_tab.h>

Inheritance diagram for SrtReceiveTab:
Inheritance graph
Collaboration diagram for SrtReceiveTab:
Collaboration graph

Public Slots

void addStream ()
 Add an empty stream to the table and start editing its host.
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.
void addEntries (const std::vector< toolx::streams::SrtStreamEntry > &entries)
 Add receivers for transmit streams and show this tab.

Public Member Functions

 SrtReceiveTab (Ui::Dialog &ui, QWidget *parent=nullptr)
 Construct a new SRT receive tab, wire up the widgets and load the saved rows.
 ~SrtReceiveTab () final
 Stop all the players.
 SrtReceiveTab (const SrtReceiveTab &)=delete
SrtReceiveTab & operator= (const SrtReceiveTab &)=delete
 SrtReceiveTab (SrtReceiveTab &&)=delete
SrtReceiveTab & operator= (SrtReceiveTab &&)=delete
int activeCount () const
 The number of streams being played.
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 toolx::streams::SrtStreamEntry &entry)
 Add a row to the table and return its index.
void setRow (int row, const toolx::streams::SrtStreamEntry &entry)
 Replace the settings of a row.
toolx::streams::SrtStreamEntry entryOfRow (int row) const
 Read the settings of a row.
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 rows.
void load ()
 Load the saved rows.

Private Attributes

Ui::Dialog & m_ui
 The main dialogue UI.
QWidget * m_parent
 Parent widget for player windows.
std::map< int, QPointer< SrtPlayer > > m_players
 The active players keyed by stream id.
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 SRT streams to receive and their player windows.

SRT has no discovery, so the rows are entered by hand or copied from the SRT transmit table. The rows (including the passphrase) are saved between runs.

Constructor & Destructor Documentation

◆ SrtReceiveTab()

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

Construct a new SRT receive tab, wire up the widgets and load the saved rows.

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

Member Function Documentation

◆ activeCount()

int SrtReceiveTab::activeCount ( ) const

The number of streams being played.

Returns
int the number of open players

◆ addEntries

void SrtReceiveTab::addEntries ( const std::vector< toolx::streams::SrtStreamEntry > & entries)
slot

Add receivers for transmit streams and show this tab.

A row with the same name and port is updated instead of being added again.

Parameters
entriesthe receiving end of each link, see toolx::streams::receiverFor()

◆ fromJson()

void SrtReceiveTab::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 SrtReceiveTab::toJson ( ) const

The table as a JSON array for the configuration file.

Returns
QJsonArray one object per row with the name and the link settings, including the passphrase

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