13#ifndef STREAMS_CAST_TAB_H
14#define STREAMS_CAST_TAB_H
26#include "../ui_toolx.h"
27#include "qt6/QtCastDiscovery.h"
51 explicit CastTab(Ui::Dialog &ui, QWidget *parent =
nullptr);
75 QJsonObject
toJson()
const;
86 void fromJson(
const QJsonObject &settings);
109 std::unique_ptr<toolx::streams::CastGenerator>
generator;
129 void fillResolutions(uint32_t max_height, uint32_t select_width, uint32_t select_height);
139 void setStateText(
int row,
const QString &text,
bool good,
bool bad);
Casts an H.264 encoded test card to a Chromecast.
QWidget * m_parent
Parent widget for message boxes.
Definition cast_tab.h:148
int activeCount() const
The number of devices being cast to.
Definition cast_tab.cpp:196
QVariantMap selectedDevice() const
The selected device, empty if none.
Definition cast_tab.cpp:367
mediax::qt6::QtCastDiscovery * m_discovery
Finds the Chromecasts.
Definition cast_tab.h:150
void setStateText(int row, const QString &text, bool good, bool bad)
Show the state of one row.
Definition cast_tab.cpp:527
~CastTab() final
Stop all the casts and discovery.
Definition cast_tab.cpp:186
void startSelected()
Cast the selected test card to the selected device.
Definition cast_tab.cpp:251
void updateStates()
Show the state of every row.
Definition cast_tab.cpp:472
bool m_loading
Set while the widgets are changed by the program so the edits are not acted on.
Definition cast_tab.h:160
TabIndicator m_indicator
Red dot on the tab header while casting.
Definition cast_tab.h:156
void fillFramerates(uint32_t select_framerate)
Fill the frame rate combo for the picture height of the selected resolution.
Definition cast_tab.cpp:443
void selectionChanged()
The settings combos follow the selected device.
Definition cast_tab.cpp:377
uint32_t m_saved_width
The saved picture width, restored when the device allows it.
Definition cast_tab.h:162
uint32_t m_saved_height
The saved picture height.
Definition cast_tab.h:164
void save() const
Save the picture and test card settings.
Definition cast_tab.cpp:537
void rebuildTable()
Rebuild the table from the discovered devices and the devices being cast to.
Definition cast_tab.cpp:308
CastTab(Ui::Dialog &ui, QWidget *parent=nullptr)
Construct a new Chromecast tab, wire up the widgets and start discovery.
Definition cast_tab.cpp:87
int selectedPattern() const
The test card index selected in the pattern combo.
Definition cast_tab.cpp:467
QTimer m_timer
Refreshes the state column.
Definition cast_tab.h:154
void refresh()
Ask the network for Chromecasts again.
Definition cast_tab.cpp:240
Ui::Dialog & m_ui
The main dialogue UI.
Definition cast_tab.h:146
void fromJson(const QJsonObject &settings)
Apply the picture and test card settings of a JSON object.
Definition cast_tab.cpp:211
QString selectedId() const
The id of the selected device, empty if none.
Definition cast_tab.cpp:362
void load()
Load the saved picture and test card settings.
Definition cast_tab.cpp:548
uint32_t m_saved_framerate
The saved frame rate.
Definition cast_tab.h:166
void updateButtons()
Enable the buttons that apply to the selection and update the count.
Definition cast_tab.cpp:513
QJsonObject toJson() const
The picture and test card settings as a JSON object for the configuration file.
Definition cast_tab.cpp:201
std::map< QString, ActiveCast > m_casts
The running casts keyed by device id.
Definition cast_tab.h:152
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.
Definition cast_tab.cpp:405
QString m_discovery_error
Message of a failed discovery.
Definition cast_tab.h:158
void stopSelected()
Stop casting to the selected device.
Definition cast_tab.cpp:298
Shows a red dot on the right of a tab header while something is running.
Definition tab_indicator.h:31
A running cast and the settings it was started with.
Definition cast_tab.h:107
uint32_t height
Picture height.
Definition cast_tab.h:115
uint32_t framerate
Frames per second.
Definition cast_tab.h:117
std::unique_ptr< toolx::streams::CastGenerator > generator
The generator.
Definition cast_tab.h:109
QVariantMap device
The device, kept in case discovery loses it while it is being cast to.
Definition cast_tab.h:111
uint32_t width
Picture width.
Definition cast_tab.h:113
A small red dot on the right of a tab header, shown while streams are running.