Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages | Examples

phTone Class Reference

The tone class is used to build sampled single and dual frequency tones that may be fed to the telephony device.generated sample tone. More...

#include <bayonne.h>

List of all members.

Public Member Functions

 phTone (const char *name, timeout_t duration, unsigned f)
 Create single frequency tone.
 phTone (const char *name, timeout_t duration, unsigned f1, unsigned f2)
 Create dual frequency tone.
 ~phTone ()
void clear (void)
 If the telephony card is capable of generating it's own tones, then it can use the clear method to remove any allocated memory for sampled data.
unsigned char * getSamples (void)
 Fetch the sample area of the tone.
timeout_t getDuration (void)
 Get the duration of the tone.
timeout_t getPlaytime (void)
 Get the duration of the tone.

Static Public Member Functions

static unsigned char linear2ulaw (int sample)
static unsigned char linear2alaw (int sample)
static unsigned char alaw2ulaw (unsigned char al)
static unsigned char ulaw2alaw (unsigned char ul)
static short ulaw2linear (unsigned char ul)
static short alaw2linear (unsigned char al)

Protected Attributes

char name [33]
unsigned char * samples
timeout_t duration
timeout_t playtime
unsigned freq1
unsigned freq2

Friends

class KeyTones
__EXPORT phTonegetphTone (const char *name)


Detailed Description

The tone class is used to build sampled single and dual frequency tones that may be fed to the telephony device.generated sample tone.

Tones are defined in the "tones" section of bayonne.conf.

Author:
David Sugar.


Constructor & Destructor Documentation

phTone::phTone const char *  name,
timeout_t  duration,
unsigned  f
 

Create single frequency tone.

Parameters:
name of tone.
duration in milliseconds.
frequency of tone.

phTone::phTone const char *  name,
timeout_t  duration,
unsigned  f1,
unsigned  f2
 

Create dual frequency tone.

Parameters:
name of tone.
duration in milliseconds.
first frequency.
second frequency.

phTone::~phTone  ) 
 


Member Function Documentation

static short phTone::alaw2linear unsigned char  al  )  [static]
 

static unsigned char phTone::alaw2ulaw unsigned char  al  )  [static]
 

void phTone::clear void   ) 
 

If the telephony card is capable of generating it's own tones, then it can use the clear method to remove any allocated memory for sampled data.

timeout_t phTone::getDuration void   )  [inline]
 

Get the duration of the tone.

Returns:
duration of tone.

timeout_t phTone::getPlaytime void   )  [inline]
 

Get the duration of the tone.

Returns:
playtime of tone.

unsigned char* phTone::getSamples void   )  [inline]
 

Fetch the sample area of the tone.

Returns:
sample area.

static unsigned char phTone::linear2alaw int  sample  )  [inline, static]
 

static unsigned char phTone::linear2ulaw int  sample  )  [static]
 

static unsigned char phTone::ulaw2alaw unsigned char  ul  )  [inline, static]
 

static short phTone::ulaw2linear unsigned char  ul  )  [static]
 


Friends And Related Function Documentation

__EXPORT phTone* getphTone const char *  name  )  [friend]
 

friend class KeyTones [friend]
 


Member Data Documentation

timeout_t phTone::duration [protected]
 

unsigned phTone::freq1 [protected]
 

unsigned phTone::freq2 [protected]
 

char phTone::name[33] [protected]
 

timeout_t phTone::playtime [protected]
 

unsigned char* phTone::samples [protected]
 


The documentation for this class was generated from the following file:
Generated on Tue Sep 13 02:19:09 2005 for Bayonne by  doxygen 1.4.4