Crossfire Client, Branches
R11627
|
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include <client-types.h>
#include "client.h"
Go to the source code of this file.
Functions | |
int | init_sounds (void) |
void | MusicCmd (const char *data, int len) |
static void | play_sound (int soundnum, int soundtype, int x, int y) |
void | Sound2Cmd (unsigned char *data, int len) |
void | SoundCmd (unsigned char *data, int len) |
Variables | |
const char *const | rcsid_gtk2_sound_c |
FILE * | sound_pipe =NULL |
ChildProcess * | sound_process |
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.
int init_sounds | ( | void | ) |
Opens the audio device, and reads relevant configuration files.
Definition at line 51 of file sound.c.
References CHILD_STDERR, CHILD_STDIN, CHILD_STDOUT, CONFIG_SOUND, LOG(), LOG_ERROR, LOG_INFO, logChildPipe(), MAX_BUF, raiseChild(), sound_pipe, sound_server, ChildProcess::tube, and want_config.
void MusicCmd | ( | const char * | data, |
int | len | ||
) |
Definition at line 208 of file sound.c.
References LOG(), and LOG_WARNING.
|
static |
Plays sound 'soundnum'. This procedure seems to be very slow - much slower than expected. It might need to run in a thread or fork off.
soundnum | The sound to play. |
soundtype | 0 for normal sounds, 1 for spell_sounds. This might get extended in the future. |
x | Offset (assumed from player) to play sound used to determine value and left vs right speaker balance. |
y | Offset (assumed from player) to play sound used to determine value and left vs right speaker balance. |
Definition at line 114 of file sound.c.
References CONFIG_SOUND, LOG(), LOG_ERROR, sound_pipe, and use_config.
Referenced by SoundCmd().
void Sound2Cmd | ( | unsigned char * | data, |
int | len | ||
) |
Definition at line 158 of file sound.c.
References LOG(), LOG_WARNING, and name.
void SoundCmd | ( | unsigned char * | data, |
int | len | ||
) |
?
data | |
len |
Definition at line 136 of file sound.c.
References GetShort_String(), LOG(), LOG_WARNING, and play_sound().
const char* const rcsid_gtk2_sound_c |
FILE* sound_pipe =NULL |
Definition at line 41 of file sound.c.
Referenced by init_sounds(), and play_sound().
ChildProcess* sound_process |