TSDuck Version 3.32-2820 (TSDuck - The MPEG Transport Stream Toolkit)
ts::SignalState Class Reference

State of a modulated broadcast signal. More...

Inheritance diagram for ts::SignalState:
Collaboration diagram for ts::SignalState:


class  Value
 Implementation of a state value. More...

Public Types

enum class  Unit {
 Unit of a state value. More...

Public Member Functions

 SignalState ()
virtual void clear ()
 Clear content, reset all values, they become "unset".
virtual std::ostream & display (std::ostream &strm, const UString &margin=UString(), int level=Severity::Info) const override
 Display the content of this object to a stream. More...
void setPercent (Variable< Value > SignalState::*field, int64_t value, int64_t min, int64_t max)
 Set a percentage value from a raw driver value. More...
virtual UString toString () const override
 Convert to a string object. More...

Public Attributes

Variable< Valuebit_error_rate
 Bit error rate (BER).
Variable< Valuepacket_error_rate
 Packet error rate (PER).
bool signal_locked
 Set to true when the signal is confirmed to be locked at the input of the demodulator.
Variable< Valuesignal_noise_ratio
 Signal to noise ratio (SNR).
Variable< Valuesignal_strength
 Signal strength.

Detailed Description

State of a modulated broadcast signal.

The type of information on the state of a modulated broadcast signal highly depends on the operating systems and drivers. The units also differ. The value can be in decibels or percentage. So, this structure contains many different fields which can be set or not.

Member Enumeration Documentation

◆ Unit

enum ts::SignalState::Unit

Unit of a state value.


A raw counter value, unit is 1, whatever it means.


A value from 0 to 100.


Milli-decibel, unit of 0.001 dB.

Member Function Documentation

◆ toString()

virtual UString ts::SignalState::toString ( ) const

Convert to a string object.

This object, converted as a string.

Implements ts::StringifyInterface.

◆ display()

virtual std::ostream& ts::SignalState::display ( std::ostream &  stream,
const UString margin = UString(),
int  level = Severity::Info 
) const

Display the content of this object to a stream.

[in,out]streamThe stream where to print the content. Standard output by default.
[in]marginThe prefix string on each line, empty by default.
[in]levelSeverity level (for instance, Severity::Info or Severity::Debug may display more information).
A reference to stream.

Implements ts::DisplayInterface.

◆ setPercent()

void ts::SignalState::setPercent ( Variable< Value > SignalState::*  field,
int64_t  value,
int64_t  min,
int64_t  max 

Set a percentage value from a raw driver value.

This method is a utility for system-specific implementations.

[out]fieldPointer-to-member for the field to update.
[in]valueRaw value as returned by the driver. The field is set with a value from 0 to 100, based on the range min to max.
[in]minMinimum value corresponding to 0 %.
[in]maxMaximum value corresponding to 100 %.

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