Crossfire Client, Branch  R11627
Functions | Variables
sound.c File Reference

Supports sound for the x11 client. More...

#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <signal.h>
#include <client-types.h>
#include "client.h"
Include dependency graph for sound.c:

Go to the source code of this file.

Functions

int init_sounds (void)
 Opens the audio device, and reads relevant configuration files.
void MusicCmd (const char *data, int len)
static void play_sound (int soundnum, int soundtype, int x, int y)
void signal_pipe (int i)
void Sound2Cmd (unsigned char *data, int len)
void SoundCmd (unsigned char *data, int len)
 ?

Variables

int nosound = 0
const char * rcsid_x11_sound_c = "$Id: sound.c 9215 2008-06-02 18:31:04Z anmaster $"
FILE * sound_pipe
ChildProcesssound_process

Detailed Description

Supports sound for the x11 client.

This is a very lightweight file. Basically, it just runs the cfsndserv program and sends the writes to it.

Definition in file sound.c.


Function Documentation

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

References CHILD_STDERR, CHILD_STDIN, CHILD_STDOUT, CONFIG_SOUND, LOG(), LOG_ERROR, LOG_INFO, logChildPipe(), MAX_BUF, raiseChild(), signal_pipe(), sound_pipe, sound_server, ChildProcess::tube, and want_config.

Referenced by applyconfig(), main(), and read_config_window().

Here is the call graph for this function:

Here is the caller graph for this function:

void MusicCmd ( const char *  data,
int  len 
)

Definition at line 173 of file sound.c.

References LOG(), and LOG_WARNING.

Here is the call graph for this function:

static void play_sound ( int  soundnum,
int  soundtype,
int  x,
int  y 
) [static]

Definition at line 86 of file sound.c.

References nosound, and sound_pipe.

void signal_pipe ( int  i)

Definition at line 45 of file sound.c.

void Sound2Cmd ( unsigned char *  data,
int  len 
)

Definition at line 123 of file sound.c.

References LOG(), LOG_WARNING, and name.

Here is the call graph for this function:

void SoundCmd ( unsigned char *  data,
int  len 
)

?

Parameters:
data
len

Definition at line 103 of file sound.c.

References GetShort_String(), LOG(), LOG_WARNING, and play_sound().

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int nosound = 0

Definition at line 40 of file sound.c.

Referenced by play_sound().

const char* rcsid_x11_sound_c = "$Id: sound.c 9215 2008-06-02 18:31:04Z anmaster $"

Definition at line 1 of file sound.c.

FILE* sound_pipe

Definition at line 49 of file sound.c.

Definition at line 50 of file sound.c.