TSDuck v3.40-4033
MPEG Transport Stream Toolkit
Loading...
Searching...
No Matches
ts::HFBand Class Reference

Definition of an HF frequency band (UHF, VHF). More...

#include <tsHFBand.h>

Public Member Functions

UString bandName () const
 Get the name of the HF band as a string.
 
uint64_t bandWidth (uint32_t channel) const
 Get the bandwidth of a channel in the HF band.
 
uint32_t channelCount () const
 Get the number of channels in the HF band.
 
UString channelList () const
 Get the list of channels in the HF band as a string.
 
uint32_t channelNumber (uint64_t frequency) const
 Compute a channel number from a frequency.
 
UString description (uint32_t channel, int32_t offset) const
 Return a human-readable description of a channel.
 
bool empty () const
 Check if there is no channel in the HF band.
 
uint32_t firstChannel () const
 Get the first channel number in the HF band.
 
int32_t firstOffset (uint32_t channel) const
 Get the first allowed offset of a channel in the HF band.
 
uint64_t frequency (uint32_t channel, int32_t offset=0) const
 Get the frequency of a channel in the HF band.
 
uint64_t highestFrequency (bool strict=false) const
 Get the highest frequency in the HF band.
 
bool inBand (uint64_t frequency, bool strict=false) const
 Check if a frequency is in the HF band.
 
bool isValidChannel (uint32_t channel) const
 Check if a channel is valid in the HF band.
 
bool isValidChannel (uint32_t channel, Report &report) const
 Check if a channel is valid in the HF band and report an error if invalid.
 
uint32_t lastChannel () const
 Get the last channel number in the HF band.
 
int32_t lastOffset (uint32_t channel) const
 Get the last allowed offset of a channel in the HF band.
 
uint64_t lowestFrequency (bool strict=false) const
 Get the lowest frequency in the HF band.
 
uint32_t nextChannel (uint32_t channel) const
 Get the next channel in the HF band.
 
int32_t offsetCount (uint64_t frequency) const
 Compute an offset count from frequency (approximate if necessary)
 
uint64_t offsetWidth (uint32_t channel) const
 Get the offset frequency width of a channel in the HF band.
 
Polarization polarization (uint32_t channel) const
 Get the polarization of a channel in the HF band.
 
uint32_t previousChannel (uint32_t channel) const
 Get the previous channel in the HF band.
 
UString regionName (bool include_aliases=false) const
 Get the region name as a string.
 

Static Public Member Functions

static UString DefaultRegion (Report &report=(ts::CerrReport::Instance()))
 Get the default region.
 
static UStringList GetAllBands (const UString &region=UString(), Report &report=(ts::CerrReport::Instance()))
 Get a list of all available HF bands for a given region in the configuration file.
 
static UStringList GetAllRegions (Report &report=(ts::CerrReport::Instance()))
 Get a list of all available regions from the configuration file.
 
static const HFBandGetBand (const UString &region=UString(), const UString &band=u"UHF", Report &report=(ts::CerrReport::Instance()), bool silent_band=false)
 Get the description of an HF band from the configuration file.
 
static void SetDefaultRegion (const UString &region=UString(), Report &report=(ts::CerrReport::Instance()))
 Set the default region.
 

Detailed Description

Definition of an HF frequency band (UHF, VHF).

Each region or country has it own definitions of the frequencies bands and layouts. The most common types of frequency bands are VHF (Very High Frequency) and UHF (Ultra High Frequency) for terrestrial TV. Some countries also define predefined layouts for satellite frequency bands. This is the case for Japan with the "BS" and "CS" satellite bands.

There is a repository of known HF bands layout per country or region. This repository is read from an XML file. There is only one instance of HFBand per country or region.

See also
ts::HFBand::GetBand()

Member Function Documentation

◆ DefaultRegion()

static UString ts::HFBand::DefaultRegion ( Report report = (ts::CerrReport::Instance()))
static

Get the default region.

Parameters
[in,out]reportWhere to report errors.
Returns
The default region. This is the value of the parameter "default.region" in the TSDuck configuration file for the current application. If undefined in the configuration file, the default is "europe".

◆ SetDefaultRegion()

static void ts::HFBand::SetDefaultRegion ( const UString region = UString(),
Report report = (ts::CerrReport::Instance()) 
)
static

Set the default region.

Parameters
[in]regionThe new region to use as default. If empty, then use the value of the parameter "default.region" in the TSDuck configuration file for the current application. If undefined in the configuration file, the default is "europe".
[in,out]reportWhere to report errors.

◆ GetAllRegions()

static UStringList ts::HFBand::GetAllRegions ( Report report = (ts::CerrReport::Instance()))
static

Get a list of all available regions from the configuration file.

Parameters
[in,out]reportWhere to report errors.
Returns
The list of all available regions.

◆ GetAllBands()

static UStringList ts::HFBand::GetAllBands ( const UString region = UString(),
Report report = (ts::CerrReport::Instance()) 
)
static

Get a list of all available HF bands for a given region in the configuration file.

Parameters
[in]regionThe region name. If empty, then use the default region.
[in,out]reportWhere to report errors.
Returns
The list of all available regions.

◆ GetBand()

static const HFBand * ts::HFBand::GetBand ( const UString region = UString(),
const UString band = u"UHF",
Report report = (ts::CerrReport::Instance()),
bool  silent_band = false 
)
static

Get the description of an HF band from the configuration file.

Parameters
[in]regionRegion of country name (not case sensitive).
[in]bandHF band type (u"UHF", u"VHF", etc).
[in,out]reportWhere to report errors.
[in]silent_bandIf true, do not report error message if the band is not found in the file. Other errors (HF band file not found, region not found) are still reported.
Returns
A pointer to the instance for the corresponding region. If the repository contains no known band for the region, return an empty object.

◆ bandName()

UString ts::HFBand::bandName ( ) const
inline

Get the name of the HF band as a string.

Returns
The name of the HF band as a string.

◆ regionName()

UString ts::HFBand::regionName ( bool  include_aliases = false) const

Get the region name as a string.

Parameters
[in]include_aliasesAlso add the list of aliases.
Returns
The region name as a string.

◆ empty()

bool ts::HFBand::empty ( ) const
inline

Check if there is no channel in the HF band.

Returns
True if there is no channel in the HF band (typically an invalid band).

◆ firstChannel()

uint32_t ts::HFBand::firstChannel ( ) const
inline

Get the first channel number in the HF band.

Returns
The first channel number in the HF band.

◆ lastChannel()

uint32_t ts::HFBand::lastChannel ( ) const
inline

Get the last channel number in the HF band.

Returns
The last channel number in the HF band.

◆ channelCount()

uint32_t ts::HFBand::channelCount ( ) const
inline

Get the number of channels in the HF band.

Note that this cannot be computed from firstChannel() and lastChannel() since an HF band can have "holes", non-existent channels.

Returns
The number of channels in the HF band.

◆ channelList()

UString ts::HFBand::channelList ( ) const

Get the list of channels in the HF band as a string.

Returns
The list of channels in the HF band as a string.

◆ isValidChannel() [1/2]

bool ts::HFBand::isValidChannel ( uint32_t  channel) const

Check if a channel is valid in the HF band.

Parameters
[in]channelChannel number.
Returns
True if channel is valid, false otherwise.

◆ isValidChannel() [2/2]

bool ts::HFBand::isValidChannel ( uint32_t  channel,
Report report 
) const

Check if a channel is valid in the HF band and report an error if invalid.

Parameters
[in]channelChannel number.
[in,out]reportWhere to report errors.
Returns
True if channel is valid, false otherwise.

◆ nextChannel()

uint32_t ts::HFBand::nextChannel ( uint32_t  channel) const

Get the next channel in the HF band.

Parameters
[in]channelChannel number.
Returns
The channel number after channel. Can be different from channel + 1 when there are "holes" in the HF band. Return zero on error (invalid channel).

◆ previousChannel()

uint32_t ts::HFBand::previousChannel ( uint32_t  channel) const

Get the previous channel in the HF band.

Parameters
[in]channelChannel number.
Returns
The channel number before channel. Can be different from channel - 1 when there are "holes" in the HF band. Return zero on error (invalid channel).

◆ lowestFrequency()

uint64_t ts::HFBand::lowestFrequency ( bool  strict = false) const

Get the lowest frequency in the HF band.

Parameters
[in]strictIf true, frequency must be strictly inside the allowed offset range of a channel. When false, only check that the frequency is inside the global band.
Returns
The frequency in Hz.

◆ highestFrequency()

uint64_t ts::HFBand::highestFrequency ( bool  strict = false) const

Get the highest frequency in the HF band.

Parameters
[in]strictIf true, frequency must be strictly inside the allowed offset range of a channel. When false, only check that the frequency is inside the global band.
Returns
The frequency in Hz.

◆ frequency()

uint64_t ts::HFBand::frequency ( uint32_t  channel,
int32_t  offset = 0 
) const

Get the frequency of a channel in the HF band.

Parameters
[in]channelChannel number.
[in]offsetOptional offset number.
Returns
The frequency in Hz or zero on error (invalid channel).

◆ bandWidth()

uint64_t ts::HFBand::bandWidth ( uint32_t  channel) const

Get the bandwidth of a channel in the HF band.

Parameters
[in]channelChannel number.
Returns
The channel width in Hz or zero on error (invalid channel).

◆ offsetWidth()

uint64_t ts::HFBand::offsetWidth ( uint32_t  channel) const

Get the offset frequency width of a channel in the HF band.

Parameters
[in]channelChannel number.
Returns
The offset frequency width in Hz.

◆ firstOffset()

int32_t ts::HFBand::firstOffset ( uint32_t  channel) const

Get the first allowed offset of a channel in the HF band.

Parameters
[in]channelChannel number.
Returns
The first allowed offset for channel.

◆ lastOffset()

int32_t ts::HFBand::lastOffset ( uint32_t  channel) const

Get the last allowed offset of a channel in the HF band.

Parameters
[in]channelChannel number.
Returns
The last allowed offset for channel.

◆ polarization()

Polarization ts::HFBand::polarization ( uint32_t  channel) const

Get the polarization of a channel in the HF band.

Parameters
[in]channelChannel number.
Returns
The polarization for channel. If POL_NONE, then no polarization in defined in the band.

◆ channelNumber()

uint32_t ts::HFBand::channelNumber ( uint64_t  frequency) const

Compute a channel number from a frequency.

Parameters
[in]frequencyFrequency in Hz.
Returns
Channel number or zero on error.

◆ offsetCount()

int32_t ts::HFBand::offsetCount ( uint64_t  frequency) const

Compute an offset count from frequency (approximate if necessary)

Parameters
[in]frequencyFrequency in Hz.
Returns
Offset count (positive or negative).

◆ inBand()

bool ts::HFBand::inBand ( uint64_t  frequency,
bool  strict = false 
) const

Check if a frequency is in the HF band.

Parameters
[in]frequencyFrequency in Hz.
[in]strictIf true, frequency must be strictly inside the allowed offset range of a channel. When false, only check that the frequency is inside the global band.
Returns
True if the frequency is in the HF band.

◆ description()

UString ts::HFBand::description ( uint32_t  channel,
int32_t  offset 
) const

Return a human-readable description of a channel.

Parameters
[in]channelChannel number.
[in]offsetChannel offset count. Displayed only if non-zero.
Returns
Channel description.

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