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

Options to update the language of an audio stream in a PMT. More...

#include <tsAudioLanguageOptions.h>

Public Member Functions

 AudioLanguageOptions ()=default
 Default constructor.
 
uint8_t getAudioStreamNumber () const
 Get the audio stream number in PMT.
 
uint8_t getAudioType () const
 Get the audio type.
 
bool getFromArgs (Args &args, const UChar *option_name, size_t index=0)
 Assign from a command-line option.
 
UString getLanguageCode () const
 Get the language code.
 
PID getPID () const
 Get audio PID.
 
bool locateByPID () const
 Check how to locate the audio stream.
 
 operator ISO639LanguageDescriptor () const
 Build an ISO-639_language_descriptor from this object (cast operator).
 
void setAudioStreamNumber (uint8_t n)
 Set the audio stream number in PMT.
 
void setAudioType (uint8_t t)
 Set the audio type.
 
void setLanguageCode (const UString &s)
 Set the language code.
 
void setPID (PID p)
 Set audio PID.
 

Static Public Member Functions

static UString GetHelpString ()
 Return a help string for the parameter syntax.
 
static UString GetSyntaxString ()
 Return a short parameter syntax.
 

Detailed Description

Options to update the language of an audio stream in a PMT.

This class is a helper for commands and tools which manipulate languages in a PMT.

On a command line, the value of an audion option is "language-code[:audio-type[:location]]".

The "language-code" is a 3-character string. The audio-type is optional, its default value is zero. The "location" indicates how to locate the audio stream. Its format is either "Pn" or "An". In the first case, "n" designates a PID value and in the second case the audio stream number. inside the PMT, starting with 1. The default location is "A1", ie. the first audio stream inside the PMT. Audio streams are numbered in increasing order of PID value.

Member Function Documentation

◆ getLanguageCode()

UString ts::AudioLanguageOptions::getLanguageCode ( ) const
inline

Get the language code.

Returns
The language code, a 3-character string.

◆ setLanguageCode()

void ts::AudioLanguageOptions::setLanguageCode ( const UString s)
inline

Set the language code.

Parameters
[in]sThe language code, must be a 3-character string.

◆ getAudioType()

uint8_t ts::AudioLanguageOptions::getAudioType ( ) const
inline

Get the audio type.

Returns
The audio type.

◆ setAudioType()

void ts::AudioLanguageOptions::setAudioType ( uint8_t  t)
inline

Set the audio type.

Parameters
[in]tThe audio type.

◆ locateByPID()

bool ts::AudioLanguageOptions::locateByPID ( ) const
inline

Check how to locate the audio stream.

Returns
True when the audio stream is located by PID value, false when it is located by stream number inside the PMT.

◆ getPID()

PID ts::AudioLanguageOptions::getPID ( ) const
inline

Get audio PID.

Returns
The audio PID number or PID_NULL if the audio stream is defined by index inside the PMT.

◆ setPID()

void ts::AudioLanguageOptions::setPID ( PID  p)
inline

Set audio PID.

Parameters
[in]pThe audio PID number.

◆ getAudioStreamNumber()

uint8_t ts::AudioLanguageOptions::getAudioStreamNumber ( ) const
inline

Get the audio stream number in PMT.

Returns
The audio stream number in PMT. The first audio stream is 1.

◆ setAudioStreamNumber()

void ts::AudioLanguageOptions::setAudioStreamNumber ( uint8_t  n)
inline

Set the audio stream number in PMT.

Parameters
[in]nThe audio stream number in PMT. The first audio stream is 1.

◆ operator ISO639LanguageDescriptor()

ts::AudioLanguageOptions::operator ISO639LanguageDescriptor ( ) const
inline

Build an ISO-639_language_descriptor from this object (cast operator).

Returns
An ISO639LanguageDescriptor object for this audio description.

◆ getFromArgs()

bool ts::AudioLanguageOptions::getFromArgs ( Args args,
const UChar option_name,
size_t  index = 0 
)

Assign from a command-line option.

Syntax of the option value: language-code[:audio-type[:location]]

Parameters
[in,out]argsCommand line arguments. Errors are also reported through the args object.
[in]option_nameThe full name of the option. If the parameter is a null pointer or an empty string, this specifies a parameter, not an option. If the specified option was not declared in the syntax of the command or declared as a non-string type, a fatal error is reported.
[in]indexThe occurence of the option to return. Zero designates the first occurence.
Returns
True on success, false on error.

◆ GetSyntaxString()

static UString ts::AudioLanguageOptions::GetSyntaxString ( )
inlinestatic

Return a short parameter syntax.

Returns
A short parameter syntax.

◆ GetHelpString()

static UString ts::AudioLanguageOptions::GetHelpString ( )
static

Return a help string for the parameter syntax.

Returns
A multi-line help string for the parameter syntax.

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