Crossfire Client, Trunk  R20507
Functions | Variables
sound.c File Reference

This file contains the sound support for the GTK V2 client. More...

#include "client.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)
 Parse the data contained by a music command coming from the server and pass the name along to cfsndserv as a quoted string. More...
 
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. More...
 

Variables

SoundServer * server
 

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

int init_sounds ( void  )

Definition at line 27 of file sound.c.

References server, and sound_server.

Referenced by main(), and read_config_dialog().

Here is the caller graph for this function:

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 122 of file sound.c.

References CONFIG_SOUND, LOG(), LOG_DEBUG, LOG_ERROR, server, and use_config.

Here is the call graph for this function:

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 40 of file sound.c.

References CONFIG_SOUND, LOG(), LOG_DEBUG, LOG_WARNING, server, and use_config.

Here is the call graph for this function:

Variable Documentation

SoundServer* server

Definition at line 25 of file sound.c.

Referenced by init_sounds(), main(), MusicCmd(), and Sound2Cmd().