# DataFormat Class Reference

A Data format. More...

`#include <yatephone.h>`

Inheritance diagram for DataFormat:

List of all members.

## Public Member Functions

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

## Protected Member Functions

virtual void | changed ()

## Detailed Description

A Data format.

An extension of a String that can parse data formats

## Constructor & Destructor Documentation

DataFormat | ( |  | ) | `[inline]`

Creates a new, empty format string.

DataFormat | ( | const char * | value | ) | `[inline]`

Creates a new initialized format.

Parameters:

  | value | Initial value of the format

DataFormat | ( | const DataFormat & | value | ) | `[inline]`

Copy constructor.

Parameters:

  | value | Initial value of the format

DataFormat | ( | const String & | value | ) | `[inline]`

Constructor from String reference

Parameters:

  | value | Initial value of the format

DataFormat | ( | const String * | value | ) | `[inline]`

Constructor from String pointer.

Parameters:

  | value | Initial value of the format

DataFormat | ( | const FormatInfo * | format | ) | `[inline]`

Constructor from format information

Parameters:

  | format | Pointer to existing FormatInfo

## Member Function Documentation

DataFormat& operator= | ( | const DataFormat & | value | ) | `[inline]`

Assignment operator.

const FormatInfo* getInfo | ( |  | ) | const

Retrive a pointer to the format information

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

int frameSize | ( | int | defValue = `0` | ) | const`[inline]`

Retrive 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

int frameTime | ( | int | defValue = `0` | ) | const`[inline]`

Retrive the frame time

Parameters:

  | defValue | Default value to return if format is unknown

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

int sampleRate | ( | int | defValue = `0` | ) | const`[inline]`

Retrive 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

int numChannels | ( | int | defValue = `1` | ) | const`[inline]`

Retrive the number of channels

Parameters:

  | defValue | Default value to return if format is unknown

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

virtual void changed | ( |  | ) | `[protected, virtual]`

Called whenever the value changed (except in constructors).

Reimplemented from String.

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

- yatephone.h