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

Manages the table of SRT transmit streams. More...

#include <srt_transmit_tab.h>

Inheritance diagram for SrtTransmitTab:
Inheritance graph
Collaboration diagram for SrtTransmitTab:
Collaboration graph

Public Slots

void addStream ()
 Add a stream with default settings.
void removeSelected ()
 Stop and remove the selected stream.
void enableAll ()
 Enable every stream.
void copyToReceive ()
 Send the receiving end of the selected streams (all if none is selected) to the receive tab.

Signals

void receiversRequested (const std::vector< toolx::streams::SrtStreamEntry > &entries)
 Receivers for transmit streams were requested.

Public Member Functions

 SrtTransmitTab (Ui::Dialog &ui, QWidget *parent=nullptr)
 Construct a new SRT transmit tab, wire up the widgets and load the saved rows.
 ~SrtTransmitTab () final
 Stop all the streams.
 SrtTransmitTab (const SrtTransmitTab &)=delete
SrtTransmitTab & operator= (const SrtTransmitTab &)=delete
 SrtTransmitTab (SrtTransmitTab &&)=delete
SrtTransmitTab & operator= (SrtTransmitTab &&)=delete
int activeCount () const
 The number of streams being transmitted.
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::SrtTransmitConfig &config)
 Add a row to the table and return its index.
toolx::streams::SrtTransmitConfig configOfRow (int row) const
 Read the settings of a row.
int idOfRow (int row) const
 The id of the stream in a row.
void toggle (int row)
 Start or stop the stream of a row after its checkbox changed.
void lockRow (int row, bool locked)
 Allow or prevent editing the settings of a row (the pattern can always change).
void setStateText (int row, const QString &text, bool good, bool bad)
 Show the state of a row.
void updateStates ()
 Refresh the state column from the running streams.
void updateButtons ()
 Enable the buttons that apply to the selection and update the count.
std::string localAddress (const toolx::streams::SrtLinkConfig &link) const
 The address of this machine, for the receiver of a listening transmitter.
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 message boxes.
std::map< int, std::unique_ptr< toolx::streams::SrtGenerator > > m_streams
 The running streams keyed by row id.
std::map< int, uint64_t > m_last_bytes
 Bytes sent at the last refresh, to show the bit rate.
QTimer m_timer
 Refreshes the state column.
int m_next_id = 1
 The id given to the next stream.
bool m_loading = false
 Set while the table is changed by the program so the edits are not acted on.

Detailed Description

Manages the table of SRT transmit streams.

Each enabled row runs an SrtGenerator. SRT has no discovery, so the "Copy to Receive" button turns the selected rows into the matching rows of the SRT receive table. The rows (including the passphrase) are saved between runs, the enabled state is not.

Constructor & Destructor Documentation

◆ SrtTransmitTab()

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

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

Parameters
uithe main dialogue UI
parentthe parent widget for message boxes

Member Function Documentation

◆ activeCount()

int SrtTransmitTab::activeCount ( ) const

The number of streams being transmitted.

Returns
int the number of enabled rows

◆ fromJson()

void SrtTransmitTab::fromJson ( const QJsonArray & streams)

Replace the table with the streams of a JSON array.

Running streams are stopped and the table is cleared. The new streams are added stopped. A VA-API codec is replaced by H.264 (OpenH264) on a machine without VA-API.

Parameters
streamsthe array made by toJson()

◆ receiversRequested

void SrtTransmitTab::receiversRequested ( const std::vector< toolx::streams::SrtStreamEntry > & entries)
signal

Receivers for transmit streams were requested.

Parameters
entriesthe receiving end of each selected link

◆ toJson()

QJsonArray SrtTransmitTab::toJson ( ) const

The table as a JSON array for the configuration file.

Returns
QJsonArray one object per row with the name, link settings (including the passphrase), picture size, frame rate, codec and test card. Whether a stream is running is not stored.

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