Go to the documentation of this file.
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.
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  */
40 #define SOUND_PRF_FORMAT "sound sym type str sounds"
42 struct sound_data {
43  char *name;
45  bool loaded;
46  void *plat_data;
47 };
50  const char *extension;
51  int type;
52 };
55 {
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 };
64 errr init_sound(const char *soundstr, int argc, char **argv);
66 void print_sound_help(void);
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
bool(* play_sound_hook)(struct sound_data *data)
Definition: sound.h:60
u32b hash
Definition: sound.h:44
int type
Definition: sound.h:51
Specifies what kind of thing a file is, when writing.
Definition: z-file.h:99
bool(* unload_sound_hook)(struct sound_data *data)
Definition: sound.h:59
char * name
Definition: sound.h:43
Definition: sound.h:42
bool(* load_sound_hook)(const char *filename, int file_type, struct sound_data *data)
Definition: sound.h:58
bool(* close_audio_hook)(void)
Definition: sound.h:57
bool(* open_audio_hook)(void)
Definition: sound.h:56
Definition: parser.c:74
const char * extension
Definition: sound.h:50
Definition: sound.h:54