Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

OpalWAVFile Class Reference

#include <opalwavfile.h>

List of all members.

Public Member Functions

 OpalWAVFile (unsigned format=fmt_PCM)
 OpalWAVFile (OpenMode mode, int opts=ModeDefault, unsigned format=fmt_PCM)
 OpalWAVFile (const PFilePath &name, OpenMode mode=ReadWrite, int opts=ModeDefault, unsigned format=fmt_PCM)
unsigned GetFormat () const
BOOL Read (void *buf, PINDEX len)
BOOL Write (const void *buf, PINDEX len)
off_t GetPosition () const
BOOL SetPosition (off_t pos, FilePositionOrigin origin=Start)
unsigned GetSampleSize () const
off_t GetDataLength ()

Protected Member Functions

void SetUnderlyingFormat (unsigned format)
BOOL IsFormatXLaw () const

Protected Attributes

unsigned realFormat
BOOL translate


Detailed Description

This class is similar to the PWavFile class found in the PWlib components library. However, it will tranparently convert all data to/from PCM format, allowing applications to be unconcerned with the underlying data format. Note that this will only work with sample-based formats that can be converted to/from PCM data, such as uLaw and aLaw


Constructor & Destructor Documentation

OpalWAVFile::OpalWAVFile unsigned  format = fmt_PCM  ) 
 

Parameters:
format  Type of WAV File to create

OpalWAVFile::OpalWAVFile OpenMode  mode,
int  opts = ModeDefault,
unsigned  format = fmt_PCM
 

Create a unique temporary file name, and open the file in the specified mode and using the specified options. Note that opening a new, unique, temporary file name in ReadOnly mode will always fail. This would only be usefull in a mode and options that will create the file.

If a WAV file is being created, the type parameter can be used to create a PCM Wave file or a G.723.1 Wave file by using #WaveType enum#

The #PChannel::IsOpen()# function may be used after object construction to determine if the file was successfully opened.

Parameters:
opts  Mode in which to open the file.
format  #OpenOptions enum# for open operation. Type of WAV File to create

OpalWAVFile::OpalWAVFile const PFilePath &  name,
OpenMode  mode = ReadWrite,
int  opts = ModeDefault,
unsigned  format = fmt_PCM
 

Create a WAV file object with the specified name and open it in the specified mode and with the specified options. If a WAV file is being created, the type parameter can be used to create a PCM Wave file or a G.723.1 Wave file by using #WaveType enum#

The #PChannel::IsOpen()# function may be used after object construction to determine if the file was successfully opened.

Parameters:
mode  Name of file to open.
opts  Mode in which to open the file.
format  #OpenOptions enum# for open operation. Type of WAV File to create


Member Function Documentation

off_t OpalWAVFile::GetDataLength  ) 
 

unsigned OpalWAVFile::GetFormat  )  const
 

All of the following functions are the same for their PWavFile equivalents, but will automatically adjust if uLaw or ALaw format

off_t OpalWAVFile::GetPosition  )  const
 

unsigned OpalWAVFile::GetSampleSize  )  const
 

BOOL OpalWAVFile::IsFormatXLaw  )  const [protected]
 

BOOL OpalWAVFile::Read void *  buf,
PINDEX  len
 

BOOL OpalWAVFile::SetPosition off_t  pos,
FilePositionOrigin  origin = Start
 

void OpalWAVFile::SetUnderlyingFormat unsigned  format  )  [protected]
 

BOOL OpalWAVFile::Write const void *  buf,
PINDEX  len
 


Member Data Documentation

unsigned OpalWAVFile::realFormat [protected]
 

BOOL OpalWAVFile::translate [protected]
 


The documentation for this class was generated from the following file:
Generated on Sat Jul 24 17:04:28 2004 for OpenH323 by doxygen 1.3.7