The ToolX configuration file: a JSON document holding every stream table and the overlay settings, written by File > Export and read by File > Import.
More...
#include <QJsonObject>
#include <QString>
Go to the source code of this file.
|
| bool | toolx::config::writeFile (const QString &path, const QJsonObject §ions, const QString &toolx_version, QString &error) |
| | Write a configuration file.
|
| bool | toolx::config::readFile (const QString &path, QJsonObject &document, QString &error) |
| | Read and check a configuration file.
|
|
|
constexpr const char * | toolx::config::kApplication = "ToolX" |
| | The value of the "application" member that marks a ToolX configuration file.
|
| constexpr int | toolx::config::kFileVersion = 1 |
|
constexpr qint64 | toolx::config::kMaxFileSize = 4 * 1024 * 1024 |
| | The largest configuration file that is read, in bytes.
|
|
constexpr const char * | toolx::config::section::kOverlays = "overlays" |
| | Time and stream name overlays: { "time": bool, "streamName": bool }.
|
|
constexpr const char * | toolx::config::section::kRtp = "rtp" |
| | RTP > RTP table: { "sapAnnouncements": bool, "streams": [ ... ] }.
|
|
constexpr const char * | toolx::config::section::kGige = "gige" |
| | GigE > Device tab: the emulated device.
|
|
constexpr const char * | toolx::config::section::kSrtTransmit = "srtTransmit" |
| | SRT > Transmit table: [ ... ].
|
|
constexpr const char * | toolx::config::section::kSrtReceive = "srtReceive" |
| | SRT > Receive table: [ ... ].
|
|
constexpr const char * | toolx::config::section::kRtsp = "rtsp" |
| | RTSP table: [ ... ].
|
|
constexpr const char * | toolx::config::section::kHls = "hls" |
| | HLS table: [ ... ].
|
|
constexpr const char * | toolx::config::section::kChromecast = "chromecast" |
| | Chromecast tab: the picture and test card settings.
|
The ToolX configuration file: a JSON document holding every stream table and the overlay settings, written by File > Export and read by File > Import.
◆ readFile()
| bool toolx::config::readFile |
( |
const QString & | path, |
|
|
QJsonObject & | document, |
|
|
QString & | error ) |
Read and check a configuration file.
- Parameters
-
| path | the file to read |
| document | set to the whole document, including the header, when true is returned |
| error | set to the reason when false is returned |
- Returns
- true if the file is a ToolX configuration file of a version this release can read
◆ writeFile()
| bool toolx::config::writeFile |
( |
const QString & | path, |
|
|
const QJsonObject & | sections, |
|
|
const QString & | toolx_version, |
|
|
QString & | error ) |
Write a configuration file.
The header (application, file version and ToolX version) is added to the sections. The file is only readable by its owner because it can hold passphrases. It is written to a temporary file first, so a failure leaves any existing file untouched.
- Parameters
-
| path | the file to write |
| sections | the sections to store, keyed by the names in section |
| toolx_version | the version of ToolX writing the file |
| error | set to the reason when false is returned |
- Returns
- true if the file was written
◆ kFileVersion
| int toolx::config::kFileVersion = 1 |
|
constexpr |
The version of the file format written by this release. Files with a higher version are refused, as they were written by a newer ToolX