Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Monitor::Utility::SpeakerNote Class Reference

Implementation using PC speaker to produce sound for a single note. More...

#include <spkrnote.h>

Inheritance diagram for Monitor::Utility::SpeakerNote:

Monitor::Utility::Note List of all members.

Public Types

typedef int Frequency
typedef int Length

Public Methods

 SpeakerNote (Frequency newFrequency, Length newLength)
 Constructor. More...

virtual ~SpeakerNote ()
 Destructor. More...

virtual void sound () const throw (Note::Busy)
 Sound once. More...

Frequency getFrequency () const
void setFrequency (Frequency newFrequency)
Length getLength () const
void setLength (Length newLength)

Private Methods

void endSound () const
 Stop sounding note. More...


Private Attributes

Frequency frequency
 Frequency of note in hertz. More...

Length length
 Length of note in milliseconds. More...


Static Private Attributes

int busy = 0
 Class variable used to indicate PC speaker is in use, cannot be used concurrently by more than one Note instance. More...


Detailed Description

Implementation using PC speaker to produce sound for a single note.

Definition at line 49 of file spkrnote.h.


Member Typedef Documentation

typedef int Monitor::Utility::SpeakerNote::Frequency
 

Definition at line 52 of file spkrnote.h.

typedef int Monitor::Utility::SpeakerNote::Length
 

Definition at line 53 of file spkrnote.h.


Constructor & Destructor Documentation

SpeakerNote::SpeakerNote Frequency    newFrequency,
Length    newLength
 

Constructor.

Parameters:
newFrequency  Frequency of note in hertz.
newLength  Length of note in milliseconds.

Definition at line 53 of file spkrnote.cpp.

References _USEMYTRACE_.

SpeakerNote::~SpeakerNote   [virtual]
 

Destructor.

Definition at line 61 of file spkrnote.cpp.

References _USEMYTRACE_.


Member Function Documentation

void SpeakerNote::endSound   const [private]
 

Stop sounding note.

Definition at line 96 of file spkrnote.cpp.

References _USEMYTRACE_, and busy.

SpeakerNote::Frequency SpeakerNote::getFrequency   const
 

Returns:
Frequency of note in hertz.

Definition at line 109 of file spkrnote.cpp.

References _USEMYTRACE_, and frequency.

SpeakerNote::Length SpeakerNote::getLength   const
 

Returns:
Length of note in milliseconds.

Definition at line 129 of file spkrnote.cpp.

References _USEMYTRACE_, and length.

void SpeakerNote::setFrequency Frequency    newFrequency
 

Parameters:
newFrequency  Frequency of note in hertz.

Definition at line 119 of file spkrnote.cpp.

References _USEMYTRACE_, and frequency.

void SpeakerNote::setLength Length    newLength
 

Parameters:
newLength  Length of note in milliseconds.

Definition at line 139 of file spkrnote.cpp.

References _USEMYTRACE_, and length.

void SpeakerNote::sound   const throw (Note::Busy) [virtual]
 

Sound once.

Exceptions:
Note::Busy  Unable to sound.

Implements Monitor::Utility::Note.

Definition at line 69 of file spkrnote.cpp.

References _USEMYTRACE_.


Member Data Documentation

int SpeakerNote::busy = 0 [static, private]
 

Class variable used to indicate PC speaker is in use, cannot be used concurrently by more than one Note instance.

Definition at line 50 of file spkrnote.cpp.

Referenced by endSound.

Frequency Monitor::Utility::SpeakerNote::frequency [private]
 

Frequency of note in hertz.

Definition at line 118 of file spkrnote.h.

Referenced by getFrequency, and setFrequency.

Length Monitor::Utility::SpeakerNote::length [private]
 

Length of note in milliseconds.

Definition at line 123 of file spkrnote.h.

Referenced by getLength, and setLength.


Generated on Wed Oct 29 20:52:39 2003 for Utility BC Turbo Vision by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002