Crossfire Client, Branches  R11627
common.c File Reference
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Sound_Info
 

Macros

#define MAX_SOUNDS   1024
 

Typedefs

typedef struct Sound_Info Sound_Info
 

Functions

int init_audio (void)
 
int init_sounds (void)
 
static void parse_sound_line (char *line, int lineno)
 
void play_sound (int soundnum, int soundtype, int x, int y)
 
int read_settings (void)
 
int SoundCmd (unsigned char *data, int len)
 
char * strdup_local (char *str)
 
int write_settings (void)
 

Variables

char * buffers =NULL
 
Sound_Info default_normal
 
Sound_Info default_spell
 
Sound_Info normal_sounds [MAX_SOUNDS]
 
Sound_Info spell_sounds [MAX_SOUNDS]
 

Macro Definition Documentation

#define MAX_SOUNDS   1024

Definition at line 8 of file common.c.

Referenced by init_sounds(), and parse_sound_line().

Typedef Documentation

typedef struct Sound_Info Sound_Info

Function Documentation

int init_audio ( void  )

Definition at line 117 of file alsa9.c.

References ALSA9_ERROR, alsa_audio_close(), AUDIODEV, sound_settings::bit8, chunk_size, err, frequency, sound_settings::frequency, handle, params, sample_size, settings, sign, sound_settings::sign, stereo, sound_settings::stereo, and zerolevel.

Referenced by init_sounds().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int init_sounds ( void  )

Opens the audio device, and reads relevant configuration files.

Returns
Returns 0 on success. On failure, the calling function will likely disable sound support/requests from the server.

Definition at line 156 of file common.c.

References sound_settings::audiodev, sound_settings::bit8, buffers, sound_settings::buffers, sound_settings::buflen, Sound_Info::data, def_sounds, Sound_Info::filename, frequency, sound_settings::frequency, init_audio(), MAX_SOUNDS, parse_sound_line(), sample_size, settings, sign, sound_settings::sign, Sound_Info::size, sounds_in_buffer, stereo, sound_settings::stereo, Sound_Info::volume, and zerolevel.

+ Here is the call graph for this function:

static void parse_sound_line ( char *  line,
int  lineno 
)
static

Definition at line 39 of file common.c.

References Sound_Info::filename, MAX_SOUNDS, strdup_local(), Sound_Info::symbolic, and Sound_Info::volume.

Referenced by init_sounds().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

int SoundCmd ( unsigned char *  data,
int  len 
)

?

Parameters
data
len

Definition at line 225 of file common.c.

References play_sound().

+ Here is the call graph for this function:

char* strdup_local ( char *  str)

Definition at line 13 of file common.c.

Referenced by parse_sound_line(), and read_settings().

+ Here is the caller graph for this function:

Variable Documentation

char* buffers =NULL

Definition at line 9 of file common.c.

Referenced by init_sounds().

Sound_Info default_normal

Definition at line 28 of file common.c.

Sound_Info default_spell

Definition at line 28 of file common.c.

Sound_Info normal_sounds[MAX_SOUNDS]

Definition at line 28 of file common.c.

Sound_Info spell_sounds[MAX_SOUNDS]

Definition at line 28 of file common.c.