Crossfire Client, Branch
R11627
|
#include <config.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <time.h>
#include <math.h>
#include <stdlib.h>
#include <ctype.h>
#include <errno.h>
#include "newclient.h"
#include "soundsdef.h"
#include <alsa/asoundlib.h>
#include <alsa/pcm_plugin.h>
#include "common.c"
Go to the source code of this file.
Data Structures | |
struct | sound_settings |
Defines | |
#define | ALSA9_ERROR(str, err) |
#define | ALSA_PCM_NEW_HW_PARAMS_API |
#define | AUDIODEV "default:0,0" |
#define | CONFIG_FILE "/.crossfire/sndconfig" |
#define | SOUND_DEBUG |
#define | SOUND_DECREASE 0.1 |
Functions | |
void | alsa_audio_close (void) |
void | alsa_recover (int e) |
int | audio_play (int buffer, int off) |
int | init_audio (void) |
int | main (int argc, char *argv[]) |
The client entry point. | |
void | play_sound (int soundnum, int soundtype, int x, int y) |
Variables | |
static snd_pcm_uframes_t | chunk_size = 0 |
int | current_buffer = 0 |
int | err = 0 |
int | first_free_buffer = 0 |
int | frequency = 0 |
snd_pcm_t * | handle = NULL |
snd_pcm_hw_params_t * | params |
static char * | rcsid_cfsndserv_c = "$Id: alsa9.c 6716 2007-06-27 18:57:31Z akirschbaum $" |
int | sample_size = 0 |
struct sound_settings | settings |
int | sign = 0 |
int | sndbuf_pos = 0 |
int | soundfd = 0 |
int * | sounds_in_buffer = NULL |
int | stereo = 0 |
int | zerolevel = 0 |
#define ALSA9_ERROR | ( | str, | |
err | |||
) |
{ \ fprintf(stderr,"ALSA9 Error: %s %s\n",str,snd_strerror(err)); }
Definition at line 85 of file alsa9.c.
Referenced by alsa_recover(), and init_audio().
#define ALSA_PCM_NEW_HW_PARAMS_API |
#define AUDIODEV "default:0,0" |
Definition at line 81 of file alsa9.c.
Referenced by init_audio().
#define CONFIG_FILE "/.crossfire/sndconfig" |
Definition at line 88 of file alsa9.c.
Referenced by read_settings(), and write_settings().
#define SOUND_DEBUG |
#define SOUND_DECREASE 0.1 |
Definition at line 91 of file alsa9.c.
Referenced by play_sound().
void alsa_audio_close | ( | void | ) |
Definition at line 115 of file alsa9.c.
References handle.
Referenced by init_audio().
void alsa_recover | ( | int | e | ) |
Definition at line 228 of file alsa9.c.
References ALSA9_ERROR, err, and handle.
Referenced by audio_play().
int audio_play | ( | int | buffer, |
int | off | ||
) |
Definition at line 260 of file alsa9.c.
References alsa_recover(), buffers, sound_settings::buflen, chunk_size, err, handle, sample_size, and settings.
Referenced by main().
int init_audio | ( | void | ) |
Definition at line 117 of file alsa9.c.
References ALSA9_ERROR, alsa_audio_close(), AUDIODEV, sound_settings::bit8, chunk_size, err, frequency, sound_settings::frequency, handle, params, sample_size, settings, sign, sound_settings::sign, stereo, sound_settings::stereo, and zerolevel.
Referenced by init_sounds().
int main | ( | int | argc, |
char * | argv[] | ||
) |
The client entry point.
argc | |
argv |
Definition at line 461 of file alsa9.c.
References audio_play(), sound_settings::buffers, buffers, sound_settings::buflen, current_buffer, err, first_free_buffer, handle, init_sounds(), rcsid_cfsndserv_c, read_settings(), settings, sndbuf_pos, SoundCmd(), sounds_in_buffer, write_settings(), and zerolevel.
void play_sound | ( | int | soundnum, |
int | soundtype, | ||
int | x, | ||
int | y | ||
) |
Definition at line 295 of file alsa9.c.
References sound_settings::bit8, sound_settings::buffers, buffers, sound_settings::buflen, current_buffer, Sound_Info::data, Sound_Info::filename, MAX_SOUNDS, normal_sounds, sample_size, settings, sound_settings::simultaneously, Sound_Info::size, SOUND_DECREASE, SOUND_NORMAL, SOUND_SPELL, sounds_in_buffer, spell_sounds, stereo, Sound_Info::symbolic, and Sound_Info::volume.
snd_pcm_uframes_t chunk_size = 0 [static] |
Definition at line 112 of file alsa9.c.
Referenced by audio_play(), and init_audio().
int current_buffer = 0 |
Definition at line 95 of file alsa9.c.
Referenced by main(), and play_sound().
int err = 0 |
Definition at line 113 of file alsa9.c.
Referenced by alsa_recover(), audio_play(), init_audio(), and main().
int first_free_buffer = 0 |
int frequency = 0 |
Definition at line 101 of file alsa9.c.
Referenced by init_audio(), and init_sounds().
snd_pcm_t* handle = NULL |
Definition at line 82 of file alsa9.c.
Referenced by alsa_audio_close(), alsa_recover(), audio_play(), init_audio(), and main().
snd_pcm_hw_params_t* params |
Definition at line 111 of file alsa9.c.
Referenced by init_audio(), script_dead(), script_init(), and script_list().
char* rcsid_cfsndserv_c = "$Id: alsa9.c 6716 2007-06-27 18:57:31Z akirschbaum $" [static] |
int sample_size = 0 |
Definition at line 101 of file alsa9.c.
Referenced by audio_play(), init_audio(), init_sounds(), and play_sound().
struct sound_settings settings |
Referenced by audio_play(), init_audio(), init_sounds(), main(), play_sound(), read_settings(), and write_settings().
int sign = 0 |
Definition at line 101 of file alsa9.c.
Referenced by init_audio(), and init_sounds().
int sndbuf_pos = 0 |
int soundfd = 0 |
Definition at line 98 of file alsa9.c.
Referenced by main(), and play_sound().
int* sounds_in_buffer = NULL |
Definition at line 94 of file alsa9.c.
Referenced by init_sounds(), main(), and play_sound().
int stereo = 0 |
Definition at line 101 of file alsa9.c.
Referenced by init_audio(), init_sounds(), and play_sound().
int zerolevel = 0 |
Definition at line 101 of file alsa9.c.
Referenced by init_audio(), init_sounds(), and main().