CTWM
Loading...
Searching...
No Matches
Macros | Functions | Variables
/usr/src/RPM/BUILD/ctwm-4.1.0/sound.c File Reference
#include "ctwm.h"
#include <rplay.h>
#include <string.h>
#include <stdio.h>
#include <ctype.h>
#include "event_names.h"
#include "sound.h"
Include dependency graph for sound.c:

Go to the source code of this file.

Macros

#define HOSTNAME_LEN   200
 
#define NMAGICEVENTS   (sizeof(magic_events) / sizeof(*magic_events))
 
#define NEVENTS   (event_names_size() + NMAGICEVENTS)
 

Functions

static chartrim_spaces (char *str)
 
static int sound_magic_event_name2num (const char *name)
 
void sound_init (void)
 
void sound_clear_list (void)
 
void sound_load_list (void)
 
void play_sound (int snd)
 
void play_startup_sound (void)
 
void play_exit_sound (void)
 
void sound_set_from_config (void)
 
void toggle_sound (void)
 
void reread_sounds (void)
 
void set_sound_host (char *host)
 
int set_sound_event_name (const char *ename, const char *soundfile)
 
int set_sound_event (int snd, const char *soundfile)
 

Variables

RPLAY ** rp = NULL
 
static int need_sound_init = 1
 
static int sound_from_config = 0
 
static int sound_fd = 0
 
static int sound_state = 1
 
static char hostname [200]
 
static const charmagic_events []
 

Macro Definition Documentation

◆ HOSTNAME_LEN

#define HOSTNAME_LEN   200

Definition at line 25 of file sound.c.

Referenced by set_sound_host(), and sound_init().

◆ NEVENTS

#define NEVENTS   (event_names_size() + NMAGICEVENTS)

Definition at line 76 of file sound.c.

Referenced by play_sound(), sound_clear_list(), and sound_init().

◆ NMAGICEVENTS

#define NMAGICEVENTS   (sizeof(magic_events) / sizeof(*magic_events))

Definition at line 55 of file sound.c.

Referenced by sound_magic_event_name2num().

Function Documentation

◆ play_exit_sound()

void play_exit_sound ( void )

Definition at line 258 of file sound.c.

References play_sound(), and sound_magic_event_name2num().

Referenced by DoShutdown().

◆ play_sound()

void play_sound ( int snd)

◆ play_startup_sound()

void play_startup_sound ( void )

Definition at line 252 of file sound.c.

References play_sound(), and sound_magic_event_name2num().

Referenced by ctwm_main().

◆ reread_sounds()

void reread_sounds ( void )

Definition at line 288 of file sound.c.

References sound_load_list().

◆ set_sound_event()

int set_sound_event ( int snd,
const char * soundfile )

Definition at line 329 of file sound.c.

References PlaceX, and rp.

Referenced by set_sound_event_name().

◆ set_sound_event_name()

int set_sound_event_name ( const char * ename,
const char * soundfile )

Definition at line 311 of file sound.c.

References event_num_by_name(), PlaceX, set_sound_event(), and sound_magic_event_name2num().

Referenced by sound_load_list().

◆ set_sound_host()

void set_sound_host ( char * host)

Definition at line 297 of file sound.c.

References hostname, HOSTNAME_LEN, PlaceX, and sound_fd.

Referenced by do_string_keyword().

◆ sound_clear_list()

void sound_clear_list ( void )

Definition at line 127 of file sound.c.

References NEVENTS, PlaceX, and rp.

Referenced by sound_load_list().

◆ sound_init()

void sound_init ( void )

Definition at line 84 of file sound.c.

References hostname, HOSTNAME_LEN, need_sound_init, NEVENTS, PlaceX, rp, and sound_fd.

Referenced by ctwm_main().

◆ sound_load_list()

void sound_load_list ( void )

Definition at line 152 of file sound.c.

References PlaceX, rp, set_sound_event_name(), sound_clear_list(), sound_from_config, and trim_spaces().

Referenced by ctwm_main(), and reread_sounds().

◆ sound_magic_event_name2num()

static int sound_magic_event_name2num ( const char * name)
static

Definition at line 58 of file sound.c.

References event_names_size(), magic_events, NMAGICEVENTS, and PlaceX.

Referenced by play_exit_sound(), play_startup_sound(), and set_sound_event_name().

◆ sound_set_from_config()

void sound_set_from_config ( void )

Definition at line 268 of file sound.c.

References sound_from_config.

◆ toggle_sound()

void toggle_sound ( void )

Definition at line 278 of file sound.c.

References sound_state.

◆ trim_spaces()

static char * trim_spaces ( char * str)
static

Definition at line 32 of file sound.c.

References PlaceX.

Referenced by sound_load_list().

Variable Documentation

◆ hostname

char hostname[200]
static

Definition at line 26 of file sound.c.

Referenced by m4_defs(), set_sound_host(), and sound_init().

◆ magic_events

const char* magic_events[]
static
Initial value:
= {
"Startup",
"Shutdown",
}

Definition at line 51 of file sound.c.

Referenced by sound_magic_event_name2num().

◆ need_sound_init

int need_sound_init = 1
static

Definition at line 21 of file sound.c.

Referenced by play_sound(), and sound_init().

◆ rp

RPLAY** rp = NULL

◆ sound_fd

int sound_fd = 0
static

Definition at line 23 of file sound.c.

Referenced by play_sound(), set_sound_host(), and sound_init().

◆ sound_from_config

int sound_from_config = 0
static

Definition at line 22 of file sound.c.

Referenced by sound_load_list(), and sound_set_from_config().

◆ sound_state

int sound_state = 1
static

Definition at line 24 of file sound.c.

Referenced by play_sound(), and toggle_sound().