#include <vxml.h>
Public Member Functions | |
PVXMLChannel (unsigned frameDelay, PINDEX frameSize) | |
~PVXMLChannel () | |
virtual BOOL | Open (PVXMLChannelInterface *_vxml) |
virtual BOOL | IsOpen () const |
virtual BOOL | Close () |
virtual BOOL | Read (void *buffer, PINDEX amount) |
virtual BOOL | Write (const void *buf, PINDEX len) |
virtual PWAVFile * | CreateWAVFile (const PFilePath &fn, BOOL recording=FALSE) |
const PString & | GetMediaFormat () const |
BOOL | IsMediaPCM () const |
virtual PString | AdjustWavFilename (const PString &fn) |
virtual BOOL | WriteFrame (const void *buf, PINDEX len)=0 |
virtual BOOL | IsSilenceFrame (const void *buf, PINDEX len) const =0 |
virtual BOOL | QueueRecordable (PVXMLRecordable *newItem) |
BOOL | StartRecording (const PFilePath &fn, unsigned finalSilence=3000, unsigned maxDuration=30000) |
BOOL | EndRecording () |
BOOL | IsRecording () const |
virtual BOOL | ReadFrame (void *buffer, PINDEX amount)=0 |
virtual PINDEX | CreateSilenceFrame (void *buffer, PINDEX amount)=0 |
virtual void | GetBeepData (PBYTEArray &, unsigned) |
virtual BOOL | QueueResource (const PURL &url, PINDEX repeat=1, PINDEX delay=0) |
virtual BOOL | QueuePlayable (const PString &type, const PString &str, PINDEX repeat=1, PINDEX delay=0, BOOL autoDelete=FALSE) |
virtual BOOL | QueuePlayable (PVXMLPlayable *newItem) |
virtual BOOL | QueueData (const PBYTEArray &data, PINDEX repeat=1, PINDEX delay=0) |
virtual BOOL | QueueFile (const PString &fn, PINDEX repeat=1, PINDEX delay=0, BOOL autoDelete=FALSE) |
virtual BOOL | QueueCommand (const PString &cmd, PINDEX repeat=1, PINDEX delay=0) |
virtual void | FlushQueue () |
virtual BOOL | IsPlaying () const |
void | SetPause (BOOL _pause) |
void | SetName (const PString &name) |
unsigned | GetSampleFrequency () const |
Protected Attributes | |
PVXMLChannelInterface * | vxmlInterface |
unsigned | sampleFrequency |
PString | mediaFormat |
PString | wavFilePrefix |
PMutex | channelWriteMutex |
PMutex | channelReadMutex |
BOOL | closed |
BOOL | recording |
PVXMLRecordable * | recordable |
unsigned | finalSilence |
unsigned | silenceRun |
BOOL | playing |
PMutex | queueMutex |
PVXMLQueue | playQueue |
PVXMLPlayable * | currentPlayItem |
BOOL | paused |
int | silentCount |
int | totalData |
PTimer | delayTimer |
PString | channelName |
PVXMLChannel::PVXMLChannel | ( | unsigned | frameDelay, | |
PINDEX | frameSize | |||
) |
PVXMLChannel::~PVXMLChannel | ( | ) |
virtual BOOL 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, | |
BOOL | recording = FALSE | |||
) | [virtual] |
BOOL PVXMLChannel::EndRecording | ( | ) |
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 sampleFrequency.
BOOL PVXMLChannel::IsMediaPCM | ( | ) | const [inline] |
References mediaFormat.
virtual BOOL 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.
BOOL PVXMLChannel::IsRecording | ( | ) | const [inline] |
References recording.
virtual BOOL PVXMLChannel::IsSilenceFrame | ( | const void * | buf, | |
PINDEX | len | |||
) | const [pure virtual] |
virtual BOOL PVXMLChannel::Open | ( | PVXMLChannelInterface * | _vxml | ) | [virtual] |
virtual BOOL PVXMLChannel::QueueCommand | ( | const PString & | cmd, | |
PINDEX | repeat = 1 , |
|||
PINDEX | delay = 0 | |||
) | [inline, virtual] |
References QueuePlayable().
virtual BOOL PVXMLChannel::QueueData | ( | const PBYTEArray & | data, | |
PINDEX | repeat = 1 , |
|||
PINDEX | delay = 0 | |||
) | [virtual] |
virtual BOOL PVXMLChannel::QueueFile | ( | const PString & | fn, | |
PINDEX | repeat = 1 , |
|||
PINDEX | delay = 0 , |
|||
BOOL | autoDelete = FALSE | |||
) | [inline, virtual] |
References QueuePlayable().
virtual BOOL PVXMLChannel::QueuePlayable | ( | PVXMLPlayable * | newItem | ) | [virtual] |
virtual BOOL PVXMLChannel::QueuePlayable | ( | const PString & | type, | |
const PString & | str, | |||
PINDEX | repeat = 1 , |
|||
PINDEX | delay = 0 , |
|||
BOOL | autoDelete = FALSE | |||
) | [virtual] |
Referenced by QueueCommand(), and QueueFile().
virtual BOOL PVXMLChannel::QueueRecordable | ( | PVXMLRecordable * | newItem | ) | [virtual] |
virtual BOOL PVXMLChannel::QueueResource | ( | const PURL & | url, | |
PINDEX | repeat = 1 , |
|||
PINDEX | delay = 0 | |||
) | [virtual] |
virtual BOOL 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 BOOL PVXMLChannel::ReadFrame | ( | void * | buffer, | |
PINDEX | amount | |||
) | [pure virtual] |
void PVXMLChannel::SetName | ( | const PString & | name | ) | [inline] |
References channelName.
void PVXMLChannel::SetPause | ( | BOOL | _pause | ) | [inline] |
References paused.
BOOL PVXMLChannel::StartRecording | ( | const PFilePath & | fn, | |
unsigned | finalSilence = 3000 , |
|||
unsigned | maxDuration = 30000 | |||
) |
virtual BOOL 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 BOOL PVXMLChannel::WriteFrame | ( | const void * | buf, | |
PINDEX | len | |||
) | [pure virtual] |
PString PVXMLChannel::channelName [protected] |
PMutex PVXMLChannel::channelReadMutex [protected] |
PMutex PVXMLChannel::channelWriteMutex [protected] |
BOOL PVXMLChannel::closed [protected] |
PVXMLPlayable* PVXMLChannel::currentPlayItem [protected] |
PTimer PVXMLChannel::delayTimer [protected] |
unsigned PVXMLChannel::finalSilence [protected] |
PString PVXMLChannel::mediaFormat [protected] |
Referenced by GetMediaFormat(), and IsMediaPCM().
BOOL PVXMLChannel::paused [protected] |
Referenced by SetPause().
BOOL PVXMLChannel::playing [protected] |
Referenced by IsPlaying().
PVXMLQueue PVXMLChannel::playQueue [protected] |
Referenced by IsPlaying().
PMutex PVXMLChannel::queueMutex [protected] |
PVXMLRecordable* PVXMLChannel::recordable [protected] |
BOOL PVXMLChannel::recording [protected] |
Referenced by IsRecording().
unsigned PVXMLChannel::sampleFrequency [protected] |
Referenced by GetSampleFrequency().
unsigned PVXMLChannel::silenceRun [protected] |
int PVXMLChannel::silentCount [protected] |
int PVXMLChannel::totalData [protected] |
PVXMLChannelInterface* PVXMLChannel::vxmlInterface [protected] |
PString PVXMLChannel::wavFilePrefix [protected] |