$treeview $search $mathjax
Stratagus
2.2.7
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include "sound.h"
Go to the source code of this file.
Classes | |
class | CSample |
sound_server.h - The sound server header file. | |
#define | MaxVolume 255 |
#define | SOUND_BUFFER_SIZE 65536 |
enum | _play_audio_flags_ { PlayAudioStream = 1, PlayAudioPreLoad = 2, PlayAudioLoadInMemory = 4, PlayAudioLoadOnDemand = 8 } |
CSample * | LoadWav (const char *name, int flags) |
CSample * | LoadVorbis (const char *name, int flags) |
Load a wav file. | |
CSample * | LoadMikMod (const char *name, int flags) |
Load a vorbis file. | |
int | SetChannelVolume (int channel, int volume) |
Load a module file. | |
int | SetChannelStereo (int channel, int stereo) |
Set the channel stereo. | |
void | SetChannelFinishedCallback (int channel, void(*callback)(int channel)) |
Set the channel's callback for when a sound finishes playing. | |
CSample * | GetChannelSample (int channel) |
Get the sample playing on a channel. | |
void | StopChannel (int channel) |
Stop a channel. | |
void | StopAllChannels () |
Stop all channels. | |
bool | UnitSoundIsPlaying (Origin *origin) |
Check if this unit plays some sound. | |
bool | SampleIsPlaying (CSample *sample) |
Check, if this sample is already playing. | |
CSample * | LoadSample (const std::string &name) |
Load a sample. | |
int | PlaySample (CSample *sample, Origin *origin=NULL) |
Play a sample. | |
int | PlaySoundFile (const std::string &name) |
Play a sound file. | |
void | SetEffectsVolume (int volume) |
Set effects volume. | |
int | GetEffectsVolume () |
Get effects volume. | |
void | SetEffectsEnabled (bool enabled) |
Set effects enabled. | |
bool | IsEffectsEnabled () |
Check if effects are enabled. | |
void | SetMusicFinishedCallback (void(*callback)()) |
Set the music finished callback. | |
int | PlayMusic (CSample *sample) |
Play a music file. | |
int | PlayMusic (const std::string &file) |
Play a music file. | |
void | StopMusic () |
Stop music playing. | |
void | SetMusicVolume (int volume) |
Set music volume. | |
int | GetMusicVolume () |
Get music volume. | |
void | SetMusicEnabled (bool enabled) |
Set music enabled. | |
bool | IsMusicEnabled () |
Check if music is enabled. | |
bool | IsMusicPlaying () |
Check if music is playing. | |
bool | SoundEnabled () |
Check if sound is enabled. | |
int | InitSound () |
Initialize the sound card. | |
void | QuitSound () |
Cleanup sound. |
#define MaxVolume 255 |
#define SOUND_BUFFER_SIZE 65536 |
enum _play_audio_flags_ |
CSample* GetChannelSample | ( | int | channel | ) |
Get the sample playing on a channel.
Get the sample playing on a channel
int GetEffectsVolume | ( | ) |
Get effects volume.
Get effects volume
int GetMusicVolume | ( | ) |
Get music volume.
Get music volume
int InitSound | ( | ) |
Initialize the sound card.
Initialize sound card.
bool IsEffectsEnabled | ( | ) |
Check if effects are enabled.
Check if effects are enabled
bool IsMusicEnabled | ( | ) |
Check if music is enabled.
Check if music is enabled
bool IsMusicPlaying | ( | ) |
Check if music is playing.
Check if music is playing
CSample* LoadMikMod | ( | const char * | name, | |
int | flags | |||
) |
Load a vorbis file.
Load MikMod.
name | Filename of the module. | |
flags | Unused. |
CSample* LoadSample | ( | const std::string & | name | ) |
Load a sample.
Load a sample
name | File name of sample (short version). |
CSample* LoadVorbis | ( | const char * | name, | |
int | flags | |||
) |
Load a wav file.
Load vorbis.
name | File name. | |
flags | Load flags. |
CSample* LoadWav | ( | const char * | name, | |
int | flags | |||
) |
Load wav.
name | File name. | |
flags | Load flags. |
int PlayMusic | ( | const std::string & | file | ) |
Play a music file.
Play a music file.
file | Name of music file, format is automatically detected. |
int PlayMusic | ( | CSample * | sample | ) |
Play a music file.
Play a music file.
sample | Music sample. |
Play a sample.
Play a sound sample
sample | Sample to play |
int PlaySoundFile | ( | const std::string & | name | ) |
Play a sound file.
Play a sound file
name | Filename of a sound to play |
void QuitSound | ( | ) |
Cleanup sound.
Cleanup sound server.
bool SampleIsPlaying | ( | CSample * | sample | ) |
Check, if this sample is already playing.
Check if this sound is already playing
void SetChannelFinishedCallback | ( | int | channel, | |
void(*)(int channel) | callback | |||
) |
Set the channel's callback for when a sound finishes playing.
Set the channel's callback for when a sound finishes playing
channel | Channel to set | |
callback | Callback to call when the sound finishes |
int SetChannelStereo | ( | int | channel, | |
int | stereo | |||
) |
Set the channel stereo.
Set the channel stereo
channel | Channel to set | |
stereo | -128 to 127, out of range will not set the stereo |
int SetChannelVolume | ( | int | channel, | |
int | volume | |||
) |
Load a module file.
Set the channel volume
Set the channel volume
channel | Channel to set | |
volume | New volume, <0 will not set the volume |
void SetEffectsEnabled | ( | bool | enabled | ) |
Set effects enabled.
Set effects enabled
void SetEffectsVolume | ( | int | volume | ) |
Set effects volume.
Set the global sound volume.
volume | the sound volume 0-255 |
void SetMusicEnabled | ( | bool | enabled | ) |
Set music enabled.
Set music enabled
void SetMusicFinishedCallback | ( | void(*)() | callback | ) |
Set the music finished callback.
Set the music finished callback
void SetMusicVolume | ( | int | volume | ) |
Set music volume.
Set the music volume.
volume | the music volume 0-255 |
bool SoundEnabled | ( | ) |
Check if sound is enabled.
Check if sound is enabled
void StopAllChannels | ( | ) |
Stop all channels.
Stop all channels
void StopChannel | ( | int | channel | ) |
Stop a channel.
Stop a channel
channel | Channel to stop |
void StopMusic | ( | ) |
Stop music playing.
Stop the current playing music.
bool UnitSoundIsPlaying | ( | Origin * | origin | ) |
Check if this unit plays some sound.