_________ __ __
/ _____// |_____________ _/ |______ ____ __ __ ______
\_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
/ \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \
/_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
\/ \/ \//_____/ \/
______________________ ______________________
T H E W A R B E G I N S
Stratagus - A free fantasy real time strategy game engine
Go to the documentation of this file.
31 #ifndef __SOUND_SERVER_H__
32 #define __SOUND_SERVER_H__
47 #define SOUND_BUFFER_SIZE 65536
69 extern Mix_Music *
LoadMusic(
const std::string &name);
71 extern Mix_Chunk *
LoadSample(
const std::string &name);
76 extern int PlaySample(Mix_Chunk *sample,
void (*callback)(
int channel));
92 extern int PlayMusic(
const std::string &file);
118 #endif // !__SOUND_SERVER_H__
int GetMusicVolume()
Get music volume.
Definition: sound_server.cpp:614
bool IsEffectsEnabled()
Check if effects are enabled.
Definition: sound_server.cpp:538
void HandleSoundEvent(SDL_Event &event)
Definition: sound_server.cpp:286
void SetMusicEnabled(bool enabled)
Set music enabled.
Definition: sound_server.cpp:622
int InitSound()
Initialize the sound card.
Definition: sound_server.cpp:694
void SetMusicVolume(int volume)
Set music volume.
Definition: sound_server.cpp:601
Mix_Chunk * LoadSample(const std::string &name)
Load a sample.
Definition: sound_server.cpp:435
void SetEffectsEnabled(bool enabled)
Set effects enabled.
Definition: sound_server.cpp:530
void SetMusicFinishedCallback(void(*callback)())
Set the music finished callback.
Definition: sound_server.cpp:550
void QuitSound()
Cleanup sound.
Definition: sound_server.cpp:717
bool UnitSoundIsPlaying(Origin *origin)
Check if this unit plays some sound.
Definition: sound_server.cpp:254
HANDLE event
Definition: midiplayer.c:31
int PlaySample(Mix_Chunk *sample, Origin *origin=NULL)
Play a sample.
Definition: sound_server.cpp:499
int PlayMusic(const std::string &file)
Play a music file.
Definition: sound_server.cpp:562
int GetEffectsVolume()
Get effects volume.
Definition: sound_server.cpp:522
bool IsMusicEnabled()
Check if music is enabled.
Definition: sound_server.cpp:635
void StopAllChannels()
Stop all channels.
Definition: sound_server.cpp:353
void SetChannelStereo(int channel, int stereo)
Set the channel stereo.
Definition: sound_server.cpp:312
uint32_t SDL_SOUND_FINISHED
Definition: sound_server.cpp:60
Mix_Music * LoadMusic(const std::string &name)
Load music.
Definition: sound_server.cpp:415
int SetChannelVolume(int channel, int volume)
Set the channel volume.
Definition: sound_server.cpp:299
bool SoundEnabled()
Check if sound is enabled.
Definition: sound_server.cpp:655
bool SampleIsPlaying(Mix_Chunk *sample)
Check, if this sample is already playing.
Definition: sound_server.cpp:244
void StopChannel(int channel)
Stop a channel.
Definition: sound_server.cpp:345
Mix_Chunk * GetChannelSample(int channel)
Get the sample playing on a channel.
Definition: sound_server.cpp:332
void FreeSample(Mix_Chunk *sample)
Definition: sound_server.cpp:451
void StopMusic()
Stop music playing.
Definition: sound_server.cpp:587
int PlaySoundFile(const std::string &name)
Play a sound file.
void SetEffectsVolume(int volume)
Set effects volume.
Definition: sound_server.cpp:514
bool IsMusicPlaying()
Check if music is playing.
Definition: sound_server.cpp:643
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.