Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

SoundNode Class Reference

#include <SoundNode.h>

Inheritance diagram for SoundNode:

Inheritance graph
[legend]
List of all members.

Detailed Description

A simple StateNode that plays a sound upon startup and throws a status event on completion.

Doesn't automatically preload the sound buffer - if you want the sound file to be preloaded, you'll have to make the SoundManager::loadFile() / SoundManager::releaseFile() calls yourself.

By default, sound playback will continue even after this node has been deactivated. If this is not the behavior you desire, set the autostop flag (through setAutoStop())

Definition at line 17 of file SoundNode.h.

Public Member Functions

 SoundNode (const std::string &soundfilename="")
 constructor, specify a sound file to play
 SoundNode (const std::string &nodename, const std::string &soundfilename)
 constructor, specify instance name and sound file to play
virtual void DoStart ()
 activate the node, starts playing the sound
virtual void DoStop ()
 deactivate the node, doesn't stop the sound playback unless the autostop flag has been set
virtual void processEvent (const EventBase &)
 receive audioEGID status event and throw stateMachineEGID status event
void stopPlay ()
 interrupts playing of the current sound
std::string getFileName ()
 returns the name of the sound file associated with this node
void setFileName (std::string &soundfilename)
 sets the name of the sound file associated with this node
bool getAutoStop ()
 returns the current status of the autostop flag
void setAutoStop (bool stop)
 sets the autostop flag

Protected Member Functions

 SoundNode (const std::string &classname, const std::string &nodename, const std::string &soundfilename)
 constructor

Protected Attributes

std::string filename
 filename of sound to play, accessed through setFileName() and getFileName()
SoundManager::Play_ID curplay_id
 holds the playback identification so it can be halted any time
bool autostop
 if set to true by setAutoStop(), when this node is deactivated, playback will be halted. Otherwise, playback will continue even after the node is deactivated


The documentation for this class was generated from the following file:

Tekkotsu v3.0
Generated Fri May 11 20:08:49 2007 by Doxygen 1.4.7