Crossfire Client, Trunk
|
#include "client.h"
#include <SDL.h>
#include <SDL_mixer.h>
#include <glib-object.h>
#include "client-vala.h"
#include "sound.h"
Go to the source code of this file.
Data Structures | |
struct | sound_settings |
Typedefs | |
typedef struct sound_settings | sound_settings |
Functions | |
void | cf_play_music (const char *music_name) |
void | cf_play_sound (gint8 x, gint8 y, guint8 dir, guint8 vol, guint8 type, char const sound[static 1], char const source[static 1]) |
void | cf_snd_exit () |
int | cf_snd_init () |
static int | init_audio () |
static Mix_Chunk * | load_chunk (char const name[static 1]) |
static bool | music_is_different (char const music[static 1]) |
Variables | |
static GHashTable * | chunk_cache |
static Mix_Music * | music = NULL |
static sound_settings | settings = { 512, 4 } |
static GHashTable * | sounds |
typedef struct sound_settings sound_settings |
void cf_play_music | ( | const char * | music_name | ) |
Play a music file.
name | Name of the song to play, without file paths or extensions. |
Definition at line 172 of file cfsndserv.c.
References LOG(), LOG_DEBUG, MAXSOCKBUF, music, and music_is_different().
Referenced by hide_main_client(), and MusicCmd().
void cf_play_sound | ( | gint8 | x, |
gint8 | y, | ||
guint8 | dir, | ||
guint8 | vol, | ||
guint8 | type, | ||
char const | sound[static 1], | ||
char const | source[static 1] | ||
) |
Play a sound effect using the SDL_mixer sound system.
sound | The sound to play. |
type | 0 for normal sounds, 1 for spell_sounds. |
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 131 of file cfsndserv.c.
References load_chunk(), LOG(), LOG_DEBUG, LOG_WARNING, and sounds.
Referenced by Sound2Cmd().
void cf_snd_exit | ( | ) |
Definition at line 199 of file cfsndserv.c.
References chunk_cache, music, and sounds.
int cf_snd_init | ( | ) |
Initialize sound server.
Initialize resource paths, load sound definitions, and ready the sound subsystem.
Definition at line 80 of file cfsndserv.c.
References chunk_cache, init_audio(), and sounds.
Referenced by init_sounds().
|
static |
Initialize the sound subsystem.
Currently, this means calling SDL_Init() and Mix_OpenAudio().
Definition at line 46 of file cfsndserv.c.
References sound_settings::buflen, sound_settings::max_chunk, and settings.
Referenced by cf_snd_init().
|
static |
Definition at line 103 of file cfsndserv.c.
References chunk_cache, and MAXSOCKBUF.
Referenced by cf_play_sound().
|
static |
Definition at line 158 of file cfsndserv.c.
References MAXSOCKBUF, and music.
Referenced by cf_play_music().
|
static |
Definition at line 36 of file cfsndserv.c.
Referenced by cf_snd_exit(), cf_snd_init(), and load_chunk().
|
static |
Definition at line 33 of file cfsndserv.c.
Referenced by cf_play_music(), cf_snd_exit(), and music_is_different().
|
static |
Definition at line 34 of file cfsndserv.c.
Referenced by init_audio().
|
static |
Definition at line 37 of file cfsndserv.c.
Referenced by cf_play_sound(), cf_snd_exit(), and cf_snd_init().