____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
A futuristic real-time strategy game.
This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project.
Distributed under the "GNU General Public License"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "stratagus.h"
#include <string>
#include <map>
#include "sound.h"
#include "sound_server.h"
Go to the source code of this file.
Functions | |
| void | MapSound (const std::string &name, CSound *id) |
| < Map sound to identifier | |
| CSound * | SoundForName (const std::string &name) |
| Make a sound bound to identifier. | |
| CSound * | MakeSound (const std::string &name, const char *file[], int nb) |
| Make a sound group bound to identifier. | |
| CSound * | MakeSoundGroup (const std::string &name, CSound *first, CSound *second) |
Variables | |
| static std::map< std::string, CSound * > | SoundMap |
Definition in file sound_id.cpp.
| CSound* MakeSound | ( | const std::string & | name, | |
| const char * | file[], | |||
| int | nb | |||
| ) |
Make a sound group bound to identifier.
Ask the sound server to register a sound and store the mapping between its name and its id. Register a sound group (or an unique sound if nb==1) and get the corresponding sound id.
| name | name of this sound group (Freed by caller). | |
| file | list of sound file names | |
| nb | number of sounds |
Definition at line 99 of file sound_id.cpp.
References _C_, Assert, DebugPrint, MapSound(), RegisterSound(), and SoundMap.
Referenced by CclMakeSound().
Ask the sound server to build a special sound group.
Register two sound groups together to make a special sound (for selection). Return the corresponding id after registering it under a given name.
| name | the name of the group (handled by caller). | |
| first | id of the first group | |
| second | id of the second group |
Definition at line 129 of file sound_id.cpp.
References _C_, DebugPrint, MapSound(), RegisterTwoGroups(), and SoundMap.
Referenced by CclMakeSoundGroup().
| void MapSound | ( | const std::string & | name, | |
| CSound * | id | |||
| ) |
< Map sound to identifier
Add a new mapping (sound name to sound id) in the hash table Create a new mapping between a name and an already valid sound id.
| name | Name of the sound (now freed by caller!). | |
| id | Sound identifier. |
Definition at line 64 of file sound_id.cpp.
References SoundMap.
Referenced by CclMapSound(), MakeSound(), and MakeSoundGroup().
| CSound* SoundForName | ( | const std::string & | name | ) |
Make a sound bound to identifier.
Maps a sound name to its id
| name | Sound name. |
Definition at line 76 of file sound_id.cpp.
References _C_, Assert, DebugPrint, and SoundMap.
Referenced by CclDefineSpell(), CclSoundForName(), MissileType::Init(), InitSoundClient(), MapAnimSounds2(), MapUnitSounds(), and UIHandleButtonUp().
Definition at line 51 of file sound_id.cpp.
Referenced by MakeSound(), MakeSoundGroup(), MapSound(), and SoundForName().
1.5.6