SoundAgent Class Reference

#include <SoundAgent.h>

List of all members.

Public Member Functions

 SoundAgent ()
virtual ~SoundAgent ()
virtual OStatus DoInit (const OSystemEvent &event)
virtual OStatus DoStart (const OSystemEvent &event)
virtual OStatus DoStop (const OSystemEvent &event)
virtual OStatus DoDestroy (const OSystemEvent &event)
void NotifyCommand (const ONotifyEvent &event)
void ReadyPlay (const OReadyEvent &event)

Public Attributes

OSubject * subject [numOfSubject]
OObserver * observer [numOfObserver]

Private Member Functions

MoNetStatus Play (int index, OVRSyncKey syncKey, byte *data)
void OpenSpeaker ()
void NewSoundVectorData ()
void LoadODA ()
void SetPowerAndVolume ()
WAVError CopyWAVTo (RCRegion *region)
RCRegion * FindFreeRegion ()
void ReplyAgentResult (MoNetAgentID agt, int idx, MoNetStatus st)

Private Attributes

SoundAgentState soundAgentState
OPrimitiveID speakerID
ODesignDataID soundDataID
ODA soundODA
int playingIndex
WAV playingWAV
RCRegion * region [SOUND_NUM_BUFFER]

Static Private Attributes

const size_t SOUND_UNIT_SIZE = 1024
const size_t SOUND_NUM_BUFFER = 4


Constructor & Destructor Documentation

SoundAgent::SoundAgent  ) 
 

Definition at line 17 of file SoundAgent.cc.

References region, and SAS_IDLE.

virtual SoundAgent::~SoundAgent  )  [inline, virtual]
 

Definition at line 36 of file SoundAgent.h.


Member Function Documentation

WAVError SoundAgent::CopyWAVTo RCRegion *  region  )  [private]
 

Definition at line 315 of file SoundAgent.cc.

References WAV::CopyTo(), and playingWAV.

Referenced by Play(), and ReadyPlay().

OStatus SoundAgent::DoDestroy const OSystemEvent &  event  )  [virtual]
 

Definition at line 63 of file SoundAgent.cc.

References soundDataID.

OStatus SoundAgent::DoInit const OSystemEvent &  event  )  [virtual]
 

Definition at line 26 of file SoundAgent.cc.

References LoadODA(), NewSoundVectorData(), OpenSpeaker(), and SetPowerAndVolume().

OStatus SoundAgent::DoStart const OSystemEvent &  event  )  [virtual]
 

Definition at line 41 of file SoundAgent.cc.

References soundAgentState.

OStatus SoundAgent::DoStop const OSystemEvent &  event  )  [virtual]
 

Definition at line 52 of file SoundAgent.cc.

References soundAgentState.

RCRegion * SoundAgent::FindFreeRegion  )  [private]
 

Definition at line 322 of file SoundAgent.cc.

References region.

Referenced by Play(), and ReadyPlay().

void SoundAgent::LoadODA  )  [private]
 

Definition at line 231 of file SoundAgent.cc.

References byte, ODA::Set(), soundDataID, and soundODA.

Referenced by DoInit().

void SoundAgent::NewSoundVectorData  )  [private]
 

Definition at line 202 of file SoundAgent.cc.

References region, WAV::Set(), SOUND_UNIT_SIZE, and speakerID.

Referenced by DoInit().

void SoundAgent::NotifyCommand const ONotifyEvent &  event  ) 
 

Definition at line 73 of file SoundAgent.cc.

References MoNetAgentCommand::agent, byte, ODA::GetData(), MoNetAgentCommand::index, monetBUSY, monetINVALID_ARG, MoNetStatus, observer, Play(), ReplyAgentResult(), soundAgentState, soundODA, and MoNetAgentCommand::syncKey.

void SoundAgent::OpenSpeaker  )  [private]
 

Definition at line 176 of file SoundAgent.cc.

References speakerID.

Referenced by DoInit().

MoNetStatus SoundAgent::Play int  index,
OVRSyncKey  syncKey,
byte data
[private]
 

Definition at line 128 of file SoundAgent.cc.

References CopyWAVTo(), FindFreeRegion(), WAV::GetBitsPerSample(), WAV::GetSamplingRate(), playingIndex, playingWAV, WAV::Set(), speakerID, and subject.

Referenced by NotifyCommand().

void SoundAgent::ReadyPlay const OReadyEvent &  event  ) 
 

Definition at line 111 of file SoundAgent.cc.

References CopyWAVTo(), FindFreeRegion(), monetagentSOUND, monetCOMPLETION, playingIndex, ReplyAgentResult(), soundAgentState, and subject.

void SoundAgent::ReplyAgentResult MoNetAgentID  agt,
int  idx,
MoNetStatus  st
[private]
 

Definition at line 332 of file SoundAgent.cc.

References monetpostureANY, and subject.

Referenced by NotifyCommand(), and ReadyPlay().

void SoundAgent::SetPowerAndVolume  )  [private]
 

Definition at line 250 of file SoundAgent.cc.

References speakerID.

Referenced by DoInit().


Member Data Documentation

OObserver* SoundAgent::observer[numOfObserver]
 

Definition at line 39 of file SoundAgent.h.

Referenced by NotifyCommand().

int SoundAgent::playingIndex [private]
 

Definition at line 70 of file SoundAgent.h.

Referenced by Play(), and ReadyPlay().

WAV SoundAgent::playingWAV [private]
 

Definition at line 71 of file SoundAgent.h.

Referenced by CopyWAVTo(), and Play().

RCRegion* SoundAgent::region[SOUND_NUM_BUFFER] [private]
 

Definition at line 72 of file SoundAgent.h.

Referenced by FindFreeRegion(), NewSoundVectorData(), and SoundAgent().

const size_t SoundAgent::SOUND_NUM_BUFFER = 4 [static, private]
 

Definition at line 64 of file SoundAgent.h.

const size_t SoundAgent::SOUND_UNIT_SIZE = 1024 [static, private]
 

Definition at line 63 of file SoundAgent.h.

Referenced by NewSoundVectorData().

SoundAgentState SoundAgent::soundAgentState [private]
 

Definition at line 66 of file SoundAgent.h.

Referenced by DoStart(), DoStop(), NotifyCommand(), and ReadyPlay().

ODesignDataID SoundAgent::soundDataID [private]
 

Definition at line 68 of file SoundAgent.h.

Referenced by DoDestroy(), and LoadODA().

ODA SoundAgent::soundODA [private]
 

Definition at line 69 of file SoundAgent.h.

Referenced by LoadODA(), and NotifyCommand().

OPrimitiveID SoundAgent::speakerID [private]
 

Definition at line 67 of file SoundAgent.h.

Referenced by NewSoundVectorData(), OpenSpeaker(), Play(), and SetPowerAndVolume().

OSubject* SoundAgent::subject[numOfSubject]
 

Definition at line 38 of file SoundAgent.h.

Referenced by Play(), ReadyPlay(), and ReplyAgentResult().


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 23:04:35 2007 for openSDK by  doxygen 1.3.9.1