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

Manages the list of RTSP camera streams and their player windows. More...

#include <rtsp_tab.h>

Inheritance diagram for RtspTab:
Inheritance graph
Collaboration diagram for RtspTab:
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

 RtspTab (Ui::Dialog &ui, QWidget *parent=nullptr)
 Construct a new RTSP tab and wire up the widgets.
 ~RtspTab () final
 Stop all the players.
 RtspTab (const RtspTab &)=delete
RtspTab & operator= (const RtspTab &)=delete
 RtspTab (RtspTab &&)=delete
RtspTab & operator= (RtspTab &&)=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, const QString &user)
 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, URLs and user names.
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< RtspPlayer > > 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 RTSP camera streams and their player windows.

The names, URLs and user names are saved between runs. Passwords are not saved.

Constructor & Destructor Documentation

◆ RtspTab()

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

Construct a new RTSP tab and wire up the widgets.

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

Member Function Documentation

◆ fromJson()

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

The table as a JSON array for the configuration file.

Returns
QJsonArray one object per row with the name, URL and user name. Passwords are not stored, but a password typed into the URL is part of it.

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