Angband
|
core sound support More...
Data Structures | |
struct | sound_module |
struct | msg_snd_data |
Macros | |
#define | MAX_SOUNDS_PER_MESSAGE 16 |
#define | SOUND_DATA_ARRAY_INC 10 |
Functions | |
static struct sound_data * | grow_sound_list (void) |
static void | load_sound (struct sound_data *sound_data) |
Iterate through all the sound types supporting by the platform's sound module. More... | |
void | message_sound_define (u16b message_id, const char *sounds_str) |
Parse a string of sound names provided by the preferences parser and: More... | |
enum parser_error | parse_prefs_sound (struct parser *p) |
errr | register_sound_pref_parser (struct parser *p) |
static void | play_sound (game_event_type type, game_event_data *data, void *user) |
Play a sound of type "event". More... | |
static void | close_audio (void) |
errr | init_sound (const char *soundstr, int argc, char **argv) |
Init the sound "module". More... | |
void | print_sound_help (void) |
Print out the 'help' information for the sound module. More... | |
Variables | |
static struct msg_snd_data | message_sounds [MSG_MAX] |
static const struct sound_module | sound_modules [] |
List of sound modules in the order they should be tried. More... | |
static u16b | next_sound_id |
static struct sound_data * | sounds |
static struct sound_hooks | hooks |
static bool | preload_sounds = false |
core sound support
Copyright (c) 2016 Graeme Russ graem e.ru ss@gm ail. com
This work is free software; you can redistribute it and/or modify it under the terms of either:
a) the GNU General Public License as published by the Free Software Foundation, version 2, or
b) the "Angband licence": This software may be copied and distributed for educational, research, and not for profit purposes provided that this copyright and statement are included in all such copies. Other copyrights may also apply.
#define MAX_SOUNDS_PER_MESSAGE 16 |
Referenced by message_sound_define().
#define SOUND_DATA_ARRAY_INC 10 |
Referenced by grow_sound_list().
References sound_hooks::close_audio_hook, hooks, i, mem_free(), next_sound_id, string_free(), and sound_hooks::unload_sound_hook.
Referenced by init_sound().
|
static |
References i, mem_realloc(), mem_zalloc(), next_sound_id, SOUND_DATA_ARRAY_INC, and sounds.
Referenced by message_sound_define().
Init the sound "module".
References close_audio(), event_add_handler(), EVENT_SOUND, hooks, i, sound_module::init, sound_hooks::open_audio_hook, play_sound(), and streq.
Referenced by main().
|
static |
Iterate through all the sound types supporting by the platform's sound module.
Call the platform's sound modules 'load sound' function for each supported file type until the platform's sound module tell us that it could load the sound. NOTE: The platform's sound module does not have to load the sound into memory, it merely has to let us know that it can play the sound when asked to.
References ANGBAND_DIR_SOUNDS, sound_file_type::extension, file_exists(), hooks, i, sound_hooks::load_sound_hook, mem_free(), mem_zalloc(), my_strcpy(), sound_data::name, path, path_build(), plog_fmt(), string_append(), sound_hooks::supported_files_hook, supported_sound_files, and type.
Referenced by message_sound_define(), and play_sound().
Parse a string of sound names provided by the preferences parser and:
References djb2_hash(), grow_sound_list(), sound_data::hash, i, load_sound(), MAX_SOUNDS_PER_MESSAGE, message_sounds, sound_data::name, next_sound_id, msg_snd_data::num_sounds, preload_sounds, search(), msg_snd_data::sound_ids, string_free(), and string_make().
Referenced by parse_prefs_sound().
enum parser_error parse_prefs_sound | ( | struct parser * | p | ) |
References prefs_data::bypass, message_lookup_by_name(), message_sound_define(), parser_getstr(), parser_getsym(), parser_priv(), and type.
Referenced by register_sound_pref_parser().
|
static |
Play a sound of type "event".
References hooks, load_sound(), game_event_data::message, message_sounds, next_sound_id, msg_snd_data::num_sounds, sound_hooks::play_sound_hook, randint0, msg_snd_data::sound_ids, and game_event_data::type.
Referenced by init_sound().
Print out the 'help' information for the sound module.
References sound_module::help, i, int, and N_ELEMENTS.
Referenced by main().
References parse_prefs_dummy(), parse_prefs_sound(), parser_reg(), and SOUND_PRF_FORMAT.
Referenced by init_parse_prefs().
|
static |
Referenced by close_audio(), init_sound(), load_sound(), and play_sound().
|
static |
Referenced by message_sound_define(), and play_sound().
|
static |
Referenced by close_audio(), grow_sound_list(), message_sound_define(), and play_sound().
|
static |
Referenced by message_sound_define().
|
static |
List of sound modules in the order they should be tried.
|
static |
Referenced by grow_sound_list().