src/sound.h File Reference

#include "system.h"
#include "defs.h"
#include "struct.h"
#include "global.h"
#include "proto.h"

Go to the source code of this file.

Defines

#define MAX_SOUNDS_IN_DYNAMIC_WAV_CACHE   100
#define ALL_MOD_MUSICS   1
#define MAX_SOUND_CHANNELS   5000

Functions

void play_sample_using_WAV_cache (char *SoundSampleFileName, int With_Waiting, int no_double_catching)
void remove_all_samples_from_WAV_cache (void)
void LoadAndFadeInBackgroundMusic (void)


Define Documentation

#define ALL_MOD_MUSICS   1

Definition at line 14 of file sound.h.

#define MAX_SOUND_CHANNELS   5000

Definition at line 15 of file sound.h.

#define MAX_SOUNDS_IN_DYNAMIC_WAV_CACHE   100

Definition at line 13 of file sound.h.

Referenced by play_sample_using_WAV_cache_v().


Function Documentation

void LoadAndFadeInBackgroundMusic ( void   ) 

============================================ MUSIC ============================================ This function is intended to provide a convenient way of switching between different backround sounds in freedroid. If no background sound was yet running, the function should start playing the given background music. If some background sound was already playing, the function should shut down the old background music and start playing the new one.

Definition at line 283 of file sound.c.

References configuration_for_freedroid_s::Current_BG_Music_Volume, DebugPrintf(), find_file(), GameConfig, Loaded_MOD_Files, NewMusicTargetFileName, NULL, SILENCE, SOUND_DIR, and sound_on.

Referenced by OldMusicHasFinishedFadingOut(), and SwitchBackgroundMusicTo().

void play_sample_using_WAV_cache ( char *  SoundSampleFileName,
int  With_Waiting,
int  no_double_catching 
)

Definition at line 714 of file sound.c.

References play_sample_using_WAV_cache_v().

void remove_all_samples_from_WAV_cache ( void   ) 

When the sound sample volume is changed via the in-game controls, we need to re-sample everything, which is done only upon loading of the sound samples. Instead of RE-MIXING SOUND SAMPLES AGAIN AND AGAIN to adapt the sound sample volume to the users needs, we will just clear out the current wav file cache, so that when needed again, the sound files will be loaded again and then automatically re-sampled to proper volume from the play/load function itself. Perfect solution.

Definition at line 872 of file sound.c.

References DebugPrintf(), dynamic_WAV_cache, i, next_free_position_in_cache, and sound_names_in_dynamic_wav_chache.

Referenced by SetSoundFXVolume().


Generated on Mon Apr 28 21:58:00 2008 for FreedroidRPG by  doxygen 1.5.5