Angband
sound.h
Go to the documentation of this file.
1 
18 #ifndef INCLUDED_SOUND_H
19 #define INCLUDED_SOUND_H
20 
21 /*
22  * Structure to held data relating to a sound.
23  * name : Base name of the sound (no path or file extension)
24  *
25  * hash : Used to speed up searches
26  *
27  * loaded : The platform's sound module sets this flag if it has enough
28  * information to play the sound (this may mean the sound data
29  * is loaded into memory, or that the full filename has been
30  * stored in the platform data. It is up to the platform's
31  * sound module to determine what 'loaded' means. The core
32  * sound module uses this flag to check if the sound needs to
33  * be 'loaded' before attempting to play it.
34 
35  * plat_data : Platform specific structure used to store any additional
36  * data the platform's sound module needs in order to play the
37  * sound (and release resources when shut down)
38  */
39 
40 #define SOUND_PRF_FORMAT "sound sym type str sounds"
41 
42 struct sound_data {
43  char *name;
45  bool loaded;
46  void *plat_data;
47 };
48 
50  const char *extension;
51  int type;
52 };
53 
55 {
56  bool (*open_audio_hook)(void);
57  bool (*close_audio_hook)(void);
58  bool (*load_sound_hook)(const char *filename, int file_type, struct sound_data *data);
59  bool (*unload_sound_hook)(struct sound_data *data);
60  bool (*play_sound_hook)(struct sound_data *data);
61  const struct sound_file_type *(*supported_files_hook)(void);
62 };
63 
64 errr init_sound(const char *soundstr, int argc, char **argv);
66 void print_sound_help(void);
67 
68 #endif /* !INCLUDED_SOUND_H */
typedef void(PNGAPI *png_error_ptr) PNGARG((png_structp
uint32_t u32b
Definition: h-basic.h:172
Definition: sound.h:49
static term_data data[MAX_TERM_DATA]
Definition: main-nds.c:156
errr register_sound_pref_parser(struct parser *p)
Definition: sound-core.c:276
int errr
ANSI C headers.
Definition: h-basic.h:164
void * plat_data
Definition: sound.h:46
errr init_sound(const char *soundstr, int argc, char **argv)
Init the sound "module".
Definition: sound-core.c:346
void print_sound_help(void)
Print out the 'help' information for the sound module.
Definition: sound-core.c:381
bool loaded
Definition: sound.h:45
const char ** p[]
Definition: name.c:40
u32b hash
Definition: sound.h:44
int type
Definition: sound.h:51
file_type
Specifies what kind of thing a file is, when writing.
Definition: z-file.h:99
char * name
Definition: sound.h:43
Definition: sound.h:42
Definition: parser.c:74
const char * extension
Definition: sound.h:50
Definition: sound.h:54