13#ifndef STREAMS_RTSP_TAB_H
14#define STREAMS_RTSP_TAB_H
24#include "../ui_toolx.h"
44 explicit RtspTab(Ui::Dialog &ui, QWidget *parent =
nullptr);
71 void fromJson(
const QJsonArray &streams);
96 int insertRow(
const QString &name,
const QString &url,
const QString &user);
102 void setState(
int id,
const QString &state);
~RtspTab() final
Stop all the players.
Definition rtsp_tab.cpp:102
int rowOfId(int id) const
Find the row of a stream, -1 if it was removed.
Definition rtsp_tab.cpp:251
void removeSelected()
Stop and remove the selected stream.
Definition rtsp_tab.cpp:160
std::map< int, QPointer< RtspPlayer > > m_players
The active players keyed by stream id.
Definition rtsp_tab.h:115
void setState(int id, const QString &state)
Show the state of a stream.
Definition rtsp_tab.cpp:268
void stopSelected()
Close the player of the selected stream.
Definition rtsp_tab.cpp:217
void fromJson(const QJsonArray &streams)
Replace the table with the streams of a JSON array.
Definition rtsp_tab.cpp:127
bool m_loading
Set while the table is being filled so edits are not saved.
Definition rtsp_tab.h:121
int insertRow(const QString &name, const QString &url, const QString &user)
Add a row to the table and return its index.
Definition rtsp_tab.cpp:230
int idOfRow(int row) const
The id of the stream in a row.
Definition rtsp_tab.cpp:262
QWidget * m_parent
Parent widget for player windows.
Definition rtsp_tab.h:113
void load()
Load the saved streams.
Definition rtsp_tab.cpp:313
void playSelected()
Open a player for the selected stream.
Definition rtsp_tab.cpp:179
void addStream()
Add an empty stream to the table and start editing its URL.
Definition rtsp_tab.cpp:149
void save() const
Save the names, URLs and user names.
Definition rtsp_tab.cpp:299
void updateButtons()
Enable the buttons that apply to the selected stream and update the count.
Definition rtsp_tab.cpp:285
int m_next_id
The id given to the next stream.
Definition rtsp_tab.h:119
TabIndicator m_indicator
Red dot on the tab header, visible while any stream is playing.
Definition rtsp_tab.h:117
QJsonArray toJson() const
The table as a JSON array for the configuration file.
Definition rtsp_tab.cpp:113
Ui::Dialog & m_ui
The main dialogue UI.
Definition rtsp_tab.h:111
RtspTab(Ui::Dialog &ui, QWidget *parent=nullptr)
Construct a new RTSP tab and wire up the widgets.
Definition rtsp_tab.cpp:68
Shows a red dot on the right of a tab header while something is running.
Definition tab_indicator.h:31
Video player window for RTSP camera streams.
A small red dot on the right of a tab header, shown while streams are running.