CSoundPool Class Reference

Singleton used to store sounds. More...

#include <soundPool.h>

List of all members.

Static Public Member Functions

static CSoundPoolinstance ()
 
Returns:
Pointer to singleton.

static void clear ()
 Remove all sounds.
static int add (const std::string &str)
static bool play (const int i, int vol=100, int bal=0)
static bool play (ENTITY *pEnt, const int i, int vol=1000)
Info methods
static int size ()
 
Returns:
The number of sounds.


Detailed Description

Singleton used to store sounds.

(c) 2007-2008 oP group Germany GbR. All rights reserved.
This source code is provided "as is" with no warranty and must not be distributed without written permission.

Author:
Doug Poston
Version:
1.3
Date:
12/28/2007

Member Function Documentation

int CSoundPool::add ( const std::string &  str  )  [static]

Add a sound to the pool.

Note:
If a sound with the same name has already been added, this one will replace it.
Parameters:
str Name of the sound file.
Returns:
Index to the sound added (negitive number if nothing could be added).

Todo:
Replace when we use index for animation --- CDebugOut::write("CSoundPool::add(string)","Old sound replaced with new sound",str.c_str(),CDebugOut::kWarning);

bool CSoundPool::play ( const int  i,
int  vol = 100,
int  bal = 0 
) [static]

Play the sound with matching index.

Note:
This is a faster way to play sounds then using the sound name.
Parameters:
i Index to sound.
vol Volume to play the sound at (default to 100).
bal Left/right balance (defaults to 0).
Returns:
true if sound was played.

bool CSoundPool::play ( ENTITY *  pEnt,
const int  i,
int  vol = 1000 
) [static]

Play the sound with matching index.

Note:
This is a faster way to play sounds then using the sound name.
Parameters:
pEnt Entity that will play the sound.
i Index to sound.
vol Volume to play the sound at (default to 1000).
Returns:
true if sound was played.


The documentation for this class was generated from the following files:
Generated on Fri Dec 28 12:55:07 2007 for template7 by  doxygen 1.5.4