# class DataFormat

A Data format. More...

Full name | `TelEngine::DataFormat`
Definition | `#include <yatephone.h>`
Inherits | TelEngine::NamedList [public ]
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- inline DataFormat ()
- inline DataFormat (const char* value)
- inline DataFormat (const DataFormat& value)
- inline DataFormat (const String& value)
- inline DataFormat (const NamedList& value)
- inline DataFormat (const String* value)
- inline explicit DataFormat (const FormatInfo* format)
- inline DataFormat& operator= (const DataFormat& value)
- const FormatInfo* getInfo () const
- inline int frameSize (int defValue = 0) const
- inline int frameTime (int defValue = 0) const
- inline int sampleRate (int defValue = 0) const
- inline int numChannels (int defValue = 1) const

#### Protected Methods

- virtual void changed ()

## Detailed Description

An extension of a String that can parse data formats

inline DataFormat ()

### DataFormat

Creates a new, empty format string.

inline DataFormat (const char* value)

### DataFormat

Creates a new initialized format.

Parameters:

value | Initial value of the format

inline DataFormat (const DataFormat& value)

### DataFormat

Copy constructor.

Parameters:

value | Initial value of the format

inline DataFormat (const String& value)

### DataFormat

Constructor from String reference

Parameters:

value | Initial value of the format

inline DataFormat (const NamedList& value)

### DataFormat

Constructor from NamedList reference

Parameters:

value | Initial value of the format and parameters

inline DataFormat (const String* value)

### DataFormat

Constructor from String pointer.

Parameters:

value | Initial value of the format

inline explicit DataFormat (const FormatInfo* format)

### DataFormat

Constructor from format information

Parameters:

format | Pointer to existing FormatInfo

inline DataFormat& operator= (const DataFormat& value)

### operator=

Assignment operator.

Reimplemented from NamedList.

const FormatInfo* getInfo ()

### getInfo

[const]

Retrieve a pointer to the format information

Returns: Pointer to the associated format info or NULL if error

inline int frameSize (int defValue = 0)

### frameSize

[const]

Retrieve the frame size

Parameters:

defValue | Default value to return if format is unknown

Returns: Frame size in octets/frame, 0 for non-framed, defValue if unknown

inline int frameTime (int defValue = 0)

### frameTime

[const]

Retrieve the frame time

Parameters:

defValue | Default value to return if format is unknown

Returns: Frame time in microseconds, 0 for variable, defValue if unknown

inline int sampleRate (int defValue = 0)

### sampleRate

[const]

Retrieve the sample rate

Parameters:

defValue | Default value to return if format is unknown

Returns: Rate in samples/second (audio) or 1e-6 frames/second (video), 0 for unknown, defValue if unknown format

inline int numChannels (int defValue = 1)

### numChannels

[const]

Retrieve the number of channels

Parameters:

defValue | Default value to return if format is unknown

Returns: Number of channels (typically 1), defValue if unknown format

void changed ()

### changed

[protected virtual]

Called whenever the value changed (except in constructors).

Reimplemented from String.

Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.