![]() |
TSDuck v3.46-4965
MPEG Transport Stream Toolkit
|
#include <tsChannelFile.h>
Classes | |
| class | Network |
| class | Service |
| class | TransportStream |
Public Types | |
| using | NetworkPtr = std::shared_ptr<Network> |
| Safe pointer to a Network object (thread-safe). | |
| using | NetworkVector = std::vector<NetworkPtr> |
| Vector of safe pointers to Network objects. | |
| using | ServicePtr = std::shared_ptr<Service> |
| Safe pointer to a Service object (thread-safe). | |
| using | ServiceVector = std::vector<ServicePtr> |
| Vector of safe pointers to Service objects. | |
| using | TransportStreamPtr = std::shared_ptr<TransportStream> |
| Safe pointer to a TransportStream object (thread-safe). | |
| using | TransportStreamVector = std::vector<TransportStreamPtr> |
| Vector of safe pointers to TransportStream objects. | |
Static Public Member Functions | |
| static UString | DefaultFileName () |
An XML file containing the description of TV channels and their networks.
The XML template for such files is in file tsduck.channels.model.xml. This is a proprietary XML syntax from TSDuck which is used to replace the deprecated "zap" format from Linux tools such szap or tzap.
The default file location depends on the operating system:
%APPDATA%\tsduck\channels.xml $HOME/.tsduck.channels.xml
|
default |
Default constructor.
|
inline |
Set new parsing and formatting tweaks for XML files.
| [in] | tweaks | XML tweaks. |
|
inline |
Clear all networks.
| bool ts::ChannelFile::load | ( | const UString & | fileName, |
| Report & | report = (ts::CerrReport::Instance()) ) |
Load an XML file.
| [in] | fileName | XML file name. If empty, use the default file name. |
| [in,out] | report | Where to report errors. |
| bool ts::ChannelFile::load | ( | std::istream & | strm, |
| Report & | report = (ts::CerrReport::Instance()) ) |
Load an XML file.
| [in,out] | strm | A standard text stream in input mode. |
| [in,out] | report | Where to report errors. |
| bool ts::ChannelFile::parse | ( | const UString & | text, |
| Report & | report = (ts::CerrReport::Instance()) ) |
Parse an XML content.
| [in] | text | XML file content. |
| [in,out] | report | Where to report errors. |
| bool ts::ChannelFile::save | ( | const fs::path & | fileName, |
| bool | createDirectories = false, | ||
| Report & | report = (ts::CerrReport::Instance()) ) const |
Save an XML file.
| [in] | fileName | XML file name. |
| [in] | createDirectories | If true, also create intermediate directories if necessary. |
| [in,out] | report | Where to report errors. |
| UString ts::ChannelFile::toXML | ( | Report & | report = (ts::CerrReport::Instance()) | ) | const |
Serialize as XML text.
| [in,out] | report | Where to report errors. |
|
inline |
Get the file name from which the channel database was loaded.
| UString ts::ChannelFile::fileDescription | ( | ) | const |
Get a description of the file from which the channel database was loaded. Typically used in error or debug messages.
|
static |
Default XML channel file name.
|
inline |
Get the number of networks in the file.
| NetworkPtr ts::ChannelFile::networkByIndex | ( | size_t | index | ) | const |
Get a network by index in the file.
| [in] | index | Network index, from 0 to networkCount()-1. |
| NetworkPtr ts::ChannelFile::networkById | ( | uint16_t | id, |
| TunerType | type ) const |
| NetworkPtr ts::ChannelFile::networkGetOrCreate | ( | uint16_t | id, |
| TunerType | type ) |
|
inline |
Search a service by name in any network of the file.
| [out] | net | Returned network of the service. |
| [out] | ts | Returned transport stream of the service. |
| [out] | srv | Returned service. |
| [in] | name | Service name. |
| [in] | strict | If true, search exactly name. If false, the comparison is case-insensitive and spaces are ignored. If false, name can also be "major.minor" for ATSC services. |
| [in,out] | report | Where to report errors. |
| bool ts::ChannelFile::searchService | ( | NetworkPtr & | net, |
| TransportStreamPtr & | ts, | ||
| ServicePtr & | srv, | ||
| const DeliverySystemSet & | delsys, | ||
| const UString & | name, | ||
| bool | strict = true, | ||
| Report & | report = (ts::CerrReport::Instance()) ) const |
Search a service by name in any network of a given type of the file.
| [out] | net | Returned network of the service. |
| [out] | ts | Returned transport stream of the service. |
| [out] | srv | Returned service. |
| [in] | delsys | Search only for these delivery systems. If empty, search any network. |
| [in] | name | Service name. |
| [in] | strict | If true, search exactly name. If false, the comparison is case-insensitive and spaces are ignored. If false, name can also be "major.minor" for ATSC services. |
| [in,out] | report | Where to report errors. |
|
inline |
Get tuner parameters from a service name in any network of the file.
| [out] | tune | Returned modulation parameters. |
| [in] | name | Service name. |
| [in] | strict | If true, search exactly name. If false, the comparison is case-insensitive and spaces are ignored. If false, name can also be "major.minor" for ATSC services. |
| [in,out] | report | Where to report errors. |
| bool ts::ChannelFile::serviceToTuning | ( | ModulationArgs & | tune, |
| const DeliverySystemSet & | delsys, | ||
| const UString & | name, | ||
| bool | strict = true, | ||
| Report & | report = (ts::CerrReport::Instance()) ) const |
Get tuner parameters from a service name in any network of a given type of the file.
| [out] | tune | Returned modulation parameters. Unmodified if the channel is not found. |
| [in] | delsys | Search only for these delivery systems. If empty, search any network. |
| [in] | name | Service name. |
| [in] | strict | If true, search exactly name. If false, the comparison is case-insensitive and spaces are ignored. If false, name can also be "major.minor" for ATSC services. |
| [in,out] | report | Where to report errors. |