Homepage Demos Overview Downloads Tutorials Reference
Credits
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members | Related Pages | Search

SoundTestBehavior Class Reference

#include <SoundTestBehavior.h>

Inheritance diagram for SoundTestBehavior:

Inheritance graph
[legend]
List of all members.

Detailed Description

allows you to experiment with playing sounds different ways.

A different sound will be played for each of the buttons, except the head buttons. When the chin button is held down, any sounds (from this behavior) will be queued up and then played successively once the chin button is released.

Notice that this doesn't preload all needed sounds:

Definition at line 18 of file SoundTestBehavior.h.

Public Member Functions

 SoundTestBehavior ()
 Constructor.

virtual void DoStart ()
 Load some sounds, listen for button events.

virtual void DoStop ()
 Release sounds we loaded in DoStart().

virtual void processEvent (const EventBase &event)
 Play the sound corresponding to the button.

virtual std::string getName () const
 returns name to system


Static Public Member Functions

std::string getClassDescription ()
 Gives a short description of what this class of behaviors does... you should override this (but don't have to).


Protected Member Functions

void play (const char *name)
 called when a button is pressed - checks if it should enqueue or just play


Protected Attributes

SoundManager::Play_ID curplay
 current chain (may not be valid if chin button not down or time is past endtime)

unsigned int endtime
 the expected end of play time for the current chain

Event Templates
Used to match against the different buttons that have sounds mapped to them

EventBase LFr
EventBase RFr
EventBase LBk
EventBase RBk
EventBase Back

Static Protected Attributes

const bool pauseWhileChin = true
 if this is true, won't start playing chain until you release the chin button


Constructor & Destructor Documentation

SoundTestBehavior::SoundTestBehavior  )  [inline]
 

Constructor.

Definition at line 21 of file SoundTestBehavior.h.

References Back, ButtonSourceID::BackButSID, curplay, endtime, LBk, ButtonSourceID::LBkPawSID, LFr, ButtonSourceID::LFrPawSID, RBk, ButtonSourceID::RBkPawSID, RFr, and ButtonSourceID::RFrPawSID.


Member Function Documentation

virtual void SoundTestBehavior::DoStart  )  [inline, virtual]
 

Load some sounds, listen for button events.

Reimplemented from BehaviorBase.

Definition at line 32 of file SoundTestBehavior.h.

References EventRouter::addListener(), EventBase::buttonEGID, BehaviorBase::DoStart(), erouter, SoundManager::LoadFile(), and sndman.

virtual void SoundTestBehavior::DoStop  )  [inline, virtual]
 

Release sounds we loaded in DoStart().

Reimplemented from BehaviorBase.

Definition at line 41 of file SoundTestBehavior.h.

References BehaviorBase::DoStop(), erouter, SoundManager::ReleaseFile(), EventRouter::removeListener(), and sndman.

std::string SoundTestBehavior::getClassDescription  )  [inline, static]
 

Gives a short description of what this class of behaviors does... you should override this (but don't have to).

Reimplemented from BehaviorBase.

Definition at line 72 of file SoundTestBehavior.h.

virtual std::string SoundTestBehavior::getName  )  const [inline, virtual]
 

returns name to system

Implements BehaviorBase.

Definition at line 71 of file SoundTestBehavior.h.

void SoundTestBehavior::play const char *  name  )  [inline, protected]
 

called when a button is pressed - checks if it should enqueue or just play

Definition at line 75 of file SoundTestBehavior.h.

References WorldState::buttons, SoundManager::ChainFile(), ERS210Info::ChinButOffset, curplay, endtime, get_time(), SoundManager::GetRemainTime(), SoundManager::invalid_Play_ID, SoundManager::PausePlay(), pauseWhileChin, SoundManager::PlayFile(), sndman, ERS210Info::SoundBufferTime, and state.

virtual void SoundTestBehavior::processEvent const EventBase event  )  [inline, virtual]
 

Play the sound corresponding to the button.

Reimplemented from BehaviorBase.

Definition at line 50 of file SoundTestBehavior.h.

References EventBase::activateETID, Back, curplay, endtime, EventBase::getSourceID(), EventBase::getTypeID(), SoundManager::invalid_Play_ID, LBk, LFr, pauseWhileChin, play(), RBk, SoundManager::ResumePlay(), RFr, and sndman.


Member Data Documentation

EventBase SoundTestBehavior::Back [protected]
 

Definition at line 103 of file SoundTestBehavior.h.

SoundManager::Play_ID SoundTestBehavior::curplay [protected]
 

current chain (may not be valid if chin button not down or time is past endtime)

Definition at line 98 of file SoundTestBehavior.h.

unsigned int SoundTestBehavior::endtime [protected]
 

the expected end of play time for the current chain

Definition at line 99 of file SoundTestBehavior.h.

EventBase SoundTestBehavior::LBk [protected]
 

Definition at line 103 of file SoundTestBehavior.h.

EventBase SoundTestBehavior::LFr [protected]
 

Definition at line 103 of file SoundTestBehavior.h.

const bool SoundTestBehavior::pauseWhileChin = true [static, protected]
 

if this is true, won't start playing chain until you release the chin button

Definition at line 97 of file SoundTestBehavior.h.

EventBase SoundTestBehavior::RBk [protected]
 

Definition at line 103 of file SoundTestBehavior.h.

EventBase SoundTestBehavior::RFr [protected]
 

Definition at line 103 of file SoundTestBehavior.h.


The documentation for this class was generated from the following file:
Tekkotsu v1.4
Generated Sat Jul 19 00:09:11 2003 by Doxygen 1.3.2