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

Shows the Chromecasts found on the network and casts a static or animated test card to them. More...

#include <cast_tab.h>

Inheritance diagram for CastTab:
Inheritance graph
Collaboration diagram for CastTab:
Collaboration graph

Data Structures

struct  ActiveCast
 A running cast and the settings it was started with. More...

Public Slots

void refresh ()
 Ask the network for Chromecasts again.
void startSelected ()
 Cast the selected test card to the selected device.
void stopSelected ()
 Stop casting to the selected device.

Public Member Functions

 CastTab (Ui::Dialog &ui, QWidget *parent=nullptr)
 Construct a new Chromecast tab, wire up the widgets and start discovery.
 ~CastTab () final
 Stop all the casts and discovery.
 CastTab (const CastTab &)=delete
CastTab & operator= (const CastTab &)=delete
 CastTab (CastTab &&)=delete
CastTab & operator= (CastTab &&)=delete
int activeCount () const
 The number of devices being cast to.
QJsonObject toJson () const
 The picture and test card settings as a JSON object for the configuration file.
void fromJson (const QJsonObject &settings)
 Apply the picture and test card settings of a JSON object.

Private Member Functions

void rebuildTable ()
 Rebuild the table from the discovered devices and the devices being cast to.
QString selectedId () const
 The id of the selected device, empty if none.
QVariantMap selectedDevice () const
 The selected device, empty if none.
void selectionChanged ()
 The settings combos follow the selected device.
void fillResolutions (uint32_t max_height, uint32_t select_width, uint32_t select_height)
 Fill the resolution combo for the tallest picture a device plays.
void fillFramerates (uint32_t select_framerate)
 Fill the frame rate combo for the picture height of the selected resolution.
int selectedPattern () const
 The test card index selected in the pattern combo.
void updateStates ()
 Show the state of every row.
void updateButtons ()
 Enable the buttons that apply to the selection and update the count.
void setStateText (int row, const QString &text, bool good, bool bad)
 Show the state of one row.
void save () const
 Save the picture and test card settings.
void load ()
 Load the saved picture and test card settings.

Private Attributes

Ui::Dialog & m_ui
 The main dialogue UI.
QWidget * m_parent
 Parent widget for message boxes.
mediax::qt6::QtCastDiscovery * m_discovery = nullptr
 Finds the Chromecasts.
std::map< QString, ActiveCast > m_casts
 The running casts keyed by device id.
QTimer m_timer
 Refreshes the state column.
TabIndicator m_indicator
 Red dot on the tab header while casting.
QString m_discovery_error
 Message of a failed discovery.
bool m_loading = false
 Set while the widgets are changed by the program so the edits are not acted on.
uint32_t m_saved_width = 1280
 The saved picture width, restored when the device allows it.
uint32_t m_saved_height = 720
 The saved picture height.
uint32_t m_saved_framerate = 25
 The saved frame rate.

Detailed Description

Shows the Chromecasts found on the network and casts a static or animated test card to them.

Discovery starts with the tab. The resolution list offers what the selected device is expected to play (see toolx::streams::castMaxHeight()), the frame rates follow the resolution. The test card can be changed while casting, the picture size can not. Every device can be cast to at once. The last settings are saved between runs, the casts are not.

Constructor & Destructor Documentation

◆ CastTab()

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

Construct a new Chromecast tab, wire up the widgets and start discovery.

Parameters
uithe main dialogue UI
parentthe parent widget for message boxes

Member Function Documentation

◆ activeCount()

int CastTab::activeCount ( ) const

The number of devices being cast to.

Returns
int the number of running casts

◆ fromJson()

void CastTab::fromJson ( const QJsonObject & settings)

Apply the picture and test card settings of a JSON object.

The picture size and frame rate of casts that are running do not change. The test card is applied to the selected device if it is being cast to. A size the selected device does not play is replaced by the nearest size it does when it is selected.

Parameters
settingsthe object made by toJson()

◆ toJson()

QJsonObject CastTab::toJson ( ) const

The picture and test card settings as a JSON object for the configuration file.

Returns
QJsonObject { "width", "height", "framerate", "pattern" }, the test card by name

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