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

#include <tsAudioLanguageOptions.h>

Public Member Functions

 AudioLanguageOptions ()=default
uint8_t getAudioStreamNumber () const
uint8_t getAudioType () const
bool getFromArgs (Args &args, const UChar *option_name, size_t index=0)
UString getLanguageCode () const
PID getPID () const
bool locateByPID () const
 operator ISO639LanguageDescriptor () const
void setAudioStreamNumber (uint8_t n)
void setAudioType (uint8_t t)
void setLanguageCode (const UString &s)
void setPID (PID p)

Static Public Member Functions

static UString GetHelpString ()
static UString GetSyntaxString ()

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 audio 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.

Constructor & Destructor Documentation

◆ AudioLanguageOptions()

ts::AudioLanguageOptions::AudioLanguageOptions ( )
default

Default constructor.

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 occurrence of the option to return. Zero designates the first occurrence.
Returns
True on success, false on error.

◆ GetSyntaxString()

UString ts::AudioLanguageOptions::GetSyntaxString ( )
inlinestatic

Return a short parameter syntax.

Returns
A short parameter syntax.

◆ GetHelpString()

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: