PTLib
Version 2.10.4
|
#include <vxml.h>
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 |
PVXMLChannel::PVXMLChannel | ( | unsigned | frameDelay, |
PINDEX | frameSize | ||
) |
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.
Reimplemented from PIndirectChannel.
virtual PINDEX PVXMLChannel::CreateSilenceFrame | ( | void * | buffer, |
PINDEX | amount | ||
) | [pure virtual] |
virtual PWAVFile* PVXMLChannel::CreateWAVFile | ( | const PFilePath & | fn, |
PBoolean | recording = false |
||
) | [virtual] |
virtual void PVXMLChannel::FlushQueue | ( | ) | [virtual] |
virtual void PVXMLChannel::GetBeepData | ( | PBYTEArray & | , |
unsigned | |||
) | [inline, virtual] |
const PString& PVXMLChannel::GetMediaFormat | ( | ) | const [inline] |
References mediaFormat.
unsigned PVXMLChannel::GetSampleFrequency | ( | ) | const [inline] |
References m_sampleFrequency.
PBoolean PVXMLChannel::IsMediaPCM | ( | ) | const [inline] |
References mediaFormat.
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.
Reimplemented from PIndirectChannel.
virtual PBoolean PVXMLChannel::IsPlaying | ( | ) | const [inline, virtual] |
References m_currentPlayItem, and m_playQueue.
PBoolean PVXMLChannel::IsRecording | ( | ) | const [inline] |
References m_recordable.
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] |
References QueuePlayable().
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] |
References QueuePlayable().
virtual PBoolean PVXMLChannel::QueuePlayable | ( | const PString & | type, |
const PString & | str, | ||
PINDEX | repeat = 1 , |
||
PINDEX | delay = 0 , |
||
PBoolean | autoDelete = false |
||
) | [virtual] |
Referenced by QueueCommand(), and QueueFile().
virtual PBoolean PVXMLChannel::QueuePlayable | ( | PVXMLPlayable * | newItem | ) | [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 * | buf, |
PINDEX | len | ||
) | [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.
Reimplemented from PDelayChannel.
virtual PBoolean PVXMLChannel::ReadFrame | ( | void * | buffer, |
PINDEX | amount | ||
) | [pure virtual] |
void PVXMLChannel::SetPause | ( | PBoolean | pause | ) | [inline] |
References m_paused.
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.
Reimplemented from PDelayChannel.
virtual PBoolean PVXMLChannel::WriteFrame | ( | const void * | buf, |
PINDEX | len | ||
) | [pure virtual] |
PMutex PVXMLChannel::m_channelReadMutex [protected] |
PMutex PVXMLChannel::m_channelWriteMutex [protected] |
bool PVXMLChannel::m_closed [protected] |
PVXMLPlayable* PVXMLChannel::m_currentPlayItem [protected] |
Referenced by IsPlaying().
unsigned PVXMLChannel::m_finalSilence [protected] |
bool PVXMLChannel::m_paused [protected] |
Referenced by SetPause().
PVXMLQueue PVXMLChannel::m_playQueue [protected] |
Referenced by IsPlaying().
PVXMLRecordable* PVXMLChannel::m_recordable [protected] |
Referenced by IsRecording().
unsigned PVXMLChannel::m_sampleFrequency [protected] |
Referenced by GetSampleFrequency().
unsigned PVXMLChannel::m_silenceRun [protected] |
PSimpleTimer PVXMLChannel::m_silenceTimer [protected] |
PINDEX PVXMLChannel::m_totalData [protected] |
PVXMLSession* PVXMLChannel::m_vxmlSession [protected] |
PString PVXMLChannel::mediaFormat [protected] |
Referenced by GetMediaFormat(), and IsMediaPCM().
PString PVXMLChannel::wavFilePrefix [protected] |