# PVXMLChannel Class Reference

`#include <vxml.h>`

Inheritance diagram for PVXMLChannel:

List of all members.

## Public Member Functions

| PVXMLChannel (unsigned frameDelay, PINDEX frameSize)
| ~PVXMLChannel ()
virtual PBoolean | Open (PVXMLSession *session)
virtual PBoolean | IsOpen () const
| Determine if the channel is currently open and read and write operations can be executed on it.
virtual PBoolean | Close ()
| Close the channel.
virtual PBoolean | Read (void *buffer, PINDEX amount)
| Low level read from the file channel.
virtual PBoolean | Write (const void *buf, PINDEX len)
| Low level write to the file channel.
virtual PWAVFile * | CreateWAVFile (const PFilePath &fn, PBoolean recording=false)
const PString & | GetMediaFormat () const
PBoolean | IsMediaPCM () const
virtual PString | AdjustWavFilename (const PString &fn)
virtual PBoolean | WriteFrame (const void *buf, PINDEX len)=0
virtual PBoolean | IsSilenceFrame (const void *buf, PINDEX len) const =0
virtual PBoolean | QueueRecordable (PVXMLRecordable *newItem)
PBoolean | StartRecording (const PFilePath &fn, unsigned finalSilence=3000, unsigned maxDuration=30000)
PBoolean | EndRecording ()
PBoolean | IsRecording () const
virtual PBoolean | ReadFrame (void *buffer, PINDEX amount)=0
virtual PINDEX | CreateSilenceFrame (void *buffer, PINDEX amount)=0
virtual void | GetBeepData (PBYTEArray &, unsigned)
virtual PBoolean | QueueResource (const PURL &url, PINDEX repeat=1, PINDEX delay=0)
virtual PBoolean | QueuePlayable (const PString &type, const PString &str, PINDEX repeat=1, PINDEX delay=0, PBoolean autoDelete=false)
virtual PBoolean | QueuePlayable (PVXMLPlayable *newItem)
virtual PBoolean | QueueData (const PBYTEArray &data, PINDEX repeat=1, PINDEX delay=0)
virtual PBoolean | QueueFile (const PString &fn, PINDEX repeat=1, PINDEX delay=0, PBoolean autoDelete=false)
virtual PBoolean | QueueCommand (const PString &cmd, PINDEX repeat=1, PINDEX delay=0)
virtual void | FlushQueue ()
virtual PBoolean | IsPlaying () const
void | SetPause (PBoolean pause)
unsigned | GetSampleFrequency () const
void | SetSilence (unsigned msecs)

## Protected Attributes

PVXMLSession * | m_vxmlSession
unsigned | m_sampleFrequency
PString | mediaFormat
PString | wavFilePrefix
PMutex | m_channelWriteMutex
PMutex | m_channelReadMutex
bool | m_closed
bool | m_paused
PINDEX | m_totalData
PVXMLRecordable * | m_recordable
unsigned | m_finalSilence
unsigned | m_silenceRun
PVXMLQueue | m_playQueue
PVXMLPlayable * | m_currentPlayItem
PSimpleTimer | m_silenceTimer

## Constructor & Destructor Documentation

PVXMLChannel::PVXMLChannel | ( | unsigned | frameDelay,
|  | PINDEX | frameSize |
| ) |  |  |

PVXMLChannel::~PVXMLChannel | ( |  | ) |

## Member Function Documentation

virtual PString PVXMLChannel::AdjustWavFilename | ( | const PString & | fn | ) | `[virtual]`

virtual PBoolean PVXMLChannel::Close | ( |  | ) | `[virtual]`

Close the channel.

This will detach itself from the read and write channels and delete both of them if they are auto delete.

Returns:
  true if the channel is closed.

Reimplemented from PIndirectChannel.

virtual PINDEX PVXMLChannel::CreateSilenceFrame | ( | void * | buffer,
|  | PINDEX | amount |
| ) |  |  | `[pure virtual]`

virtual PWAVFile* PVXMLChannel::CreateWAVFile | ( | const PFilePath & | fn,
|  | PBoolean | recording = `false` |
| ) |  |  | `[virtual]`

PBoolean PVXMLChannel::EndRecording | ( |  | ) |

virtual void PVXMLChannel::FlushQueue | ( |  | ) | `[virtual]`

virtual void PVXMLChannel::GetBeepData | ( | PBYTEArray & | ,
|  | unsigned |  |
| ) |  |  | `[inline, virtual]`

const PString& PVXMLChannel::GetMediaFormat | ( |  | ) | const`[inline]`

unsigned PVXMLChannel::GetSampleFrequency | ( |  | ) | const`[inline]`

PBoolean PVXMLChannel::IsMediaPCM | ( |  | ) | const`[inline]`

virtual PBoolean PVXMLChannel::IsOpen | ( |  | ) | const`[virtual]`

Determine if the channel is currently open and read and write operations can be executed on it.

For example, in the `PFile` class it returns if the file is currently open.

Returns:
  true if the channel is open.

Reimplemented from PIndirectChannel.

virtual PBoolean PVXMLChannel::IsPlaying | ( |  | ) | const`[inline, virtual]`

PBoolean PVXMLChannel::IsRecording | ( |  | ) | const`[inline]`

virtual PBoolean PVXMLChannel::IsSilenceFrame | ( | const void * | buf,
|  | PINDEX | len |
| ) |  |  | const`[pure virtual]`

virtual PBoolean PVXMLChannel::Open | ( | PVXMLSession * | session | ) | `[virtual]`

virtual PBoolean PVXMLChannel::QueueCommand | ( | const PString & | cmd,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0` |
| ) |  |  | `[inline, virtual]`

virtual PBoolean PVXMLChannel::QueueData | ( | const PBYTEArray & | data,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLChannel::QueueFile | ( | const PString & | fn,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0`,
|  | PBoolean | autoDelete = `false` |
| ) |  |  | `[inline, virtual]`

virtual PBoolean PVXMLChannel::QueuePlayable | ( | PVXMLPlayable * | newItem | ) | `[virtual]`

virtual PBoolean PVXMLChannel::QueuePlayable | ( | const PString & | type,
|  | const PString & | str,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0`,
|  | PBoolean | autoDelete = `false` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLChannel::QueueRecordable | ( | PVXMLRecordable * | newItem | ) | `[virtual]`

virtual PBoolean PVXMLChannel::QueueResource | ( | const PURL & | url,
|  | PINDEX | repeat = `1`,
|  | PINDEX | delay = `0` |
| ) |  |  | `[virtual]`

virtual PBoolean PVXMLChannel::Read | ( | void * | buffer,
|  | PINDEX | amount |
| ) |  |  | `[virtual]`

Low level read from the file channel.

The read timeout is ignored for file I/O. The GetLastReadCount() function returns the actual number of bytes read.

The GetErrorCode() function should be consulted after Read() returns false to determine what caused the failure.

Returns:
  true indicates that at least one character was read from the channel. false means no bytes were read due to timeout or some other I/O error.

Reimplemented from PDelayChannel.

virtual PBoolean PVXMLChannel::ReadFrame | ( | void * | buffer,
|  | PINDEX | amount |
| ) |  |  | `[pure virtual]`

void PVXMLChannel::SetPause | ( | PBoolean | pause | ) | `[inline]`

void PVXMLChannel::SetSilence | ( | unsigned | msecs | ) |

PBoolean PVXMLChannel::StartRecording | ( | const PFilePath & | fn,
|  | unsigned | finalSilence = `3000`,
|  | unsigned | maxDuration = `30000` |
| ) |  |  |

virtual PBoolean PVXMLChannel::Write | ( | const void * | buf,
|  | PINDEX | len |
| ) |  |  | `[virtual]`

Low level write to the file channel.

The write timeout is ignored for file I/O. The GetLastWriteCount() function returns the actual number of bytes written.

The GetErrorCode() function should be consulted after Write() returns false to determine what caused the failure.

Returns:
  true if at least len bytes were written to the channel.

Reimplemented from PDelayChannel.

virtual PBoolean PVXMLChannel::WriteFrame | ( | const void * | buf,
|  | PINDEX | len |
| ) |  |  | `[pure virtual]`

## Member Data Documentation

PMutex PVXMLChannel::m_channelReadMutex `[protected]`

PMutex PVXMLChannel::m_channelWriteMutex `[protected]`

bool PVXMLChannel::m_closed `[protected]`

PVXMLPlayable* PVXMLChannel::m_currentPlayItem `[protected]`

unsigned PVXMLChannel::m_finalSilence `[protected]`

bool PVXMLChannel::m_paused `[protected]`

PVXMLQueue PVXMLChannel::m_playQueue `[protected]`

PVXMLRecordable* PVXMLChannel::m_recordable `[protected]`

unsigned PVXMLChannel::m_sampleFrequency `[protected]`

unsigned PVXMLChannel::m_silenceRun `[protected]`

PSimpleTimer PVXMLChannel::m_silenceTimer `[protected]`

PINDEX PVXMLChannel::m_totalData `[protected]`

PVXMLSession* PVXMLChannel::m_vxmlSession `[protected]`

PString PVXMLChannel::mediaFormat `[protected]`

PString PVXMLChannel::wavFilePrefix `[protected]`

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

- vxml.h