Crossfire Client, Trunk
Functions
sound.c File Reference
#include "client.h"
#include "sound.h"
#include "client-vala.h"
Include dependency graph for sound.c:

Go to the source code of this file.

Functions

int init_sounds ()
 
void MusicCmd (const char *data, int len)
 
void Sound2Cmd (unsigned char *data, int len)
 

Detailed Description

This file contains the sound support for the GTK V2 client. It does not actually play sounds, but rather tries to run cfsndserve, which is responsible for playing sounds.

Definition in file sound.c.

Function Documentation

◆ init_sounds()

int init_sounds ( )

Definition at line 26 of file sound.c.

References cf_snd_init().

Referenced by config_check(), and main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MusicCmd()

void MusicCmd ( const char *  data,
int  len 
)

Parse the data contained by a music command coming from the server and pass the name along to cfsndserv as a quoted string.

Parameters
dataData provided following the music command from the server that hints what kind of music should play. NONE is an indication that music should stop playing.
lenLength of the string describing the music to play.

Format of the music command received in data:

music {string}

Definition at line 113 of file sound.c.

References cf_play_music(), CONFIG_SOUND, LOG(), LOG_ERROR, and use_config.

Here is the call graph for this function:

◆ Sound2Cmd()

void Sound2Cmd ( unsigned char *  data,
int  len 
)

Parse the data contained by a sound2 command coming from the server and handle playing the specified sound. See server doc/Developers/sound for details.

Parameters
dataData provided following the sound2 command from the server.
lenLength of the sound2 command data.

Format of the sound2 command recieved in data:

sound2 {x}{y}{dir}{volume}{type}{len_sound}{sound}{len_source}{source}
        b  b  b    b       b     b          str    b           str

Definition at line 38 of file sound.c.

References cf_play_sound(), CONFIG_SOUND, LOG(), LOG_WARNING, and use_config.

Here is the call graph for this function: