44#define MAX_NUM_PLUGINS 2
45#define SNDSPEC_SUFFIX ".soundspec"
46#define MUSICSPEC_SUFFIX ".musicspec"
48#define SOUNDSPEC_CAPSTR "+Freeciv-3.2-soundset"
49#define MUSICSPEC_CAPSTR "+Freeciv-3.2-musicspec"
70 const char *tag,
bool repeat,
166 log_fatal(
_(
"Plugin '%s' isn't available. Available are %s"),
172 log_error(
"Plugin %s found, but can't be initialized.",
name);
230 log_error(
_(
"Couldn't find audioset \"%s\", trying \"%s\"."),
240 const char *filename,
248 log_fatal(
"Audio spec-file \"%s\" doesn't have capability string.",
253 log_fatal(
"Audio spec-file appears incompatible:");
260 log_fatal(
"Audio spec-file claims required option(s) "
261 "which we don't support:");
285 log_verbose(
"Proceeding with sound support disabled.");
295 log_normal(
_(
"Proceeding with sound support disabled."));
296 log_normal(
_(
"For sound support, install SDL2_mixer"));
297 log_normal(
"https://github.com/libsdl-org/SDL_mixer");
312 log_verbose(
"Initializing sound using %s and %s...",
317 log_error(
"Cannot find audio spec-file \"%s\" or \"%s\"",
319 log_normal(
_(
"To get sound you need to download a sound set!"));
321 "https://www.freeciv.org/wiki/Sounds");
322 log_normal(
_(
"Proceeding with sound support disabled."));
341 "soundspec.options");
346 "musicspec.options");
361 log_normal(
_(
"Proceeding with sound support disabled."));
368 log_normal(
_(
"No real audio subsystem managed to initialize!"));
369 log_normal(
_(
"Perhaps there is some misconfiguration or bad permissions."));
370 log_normal(
_(
"Proceeding with sound support disabled."));
427 const char *tag,
bool repeat,
int exclude,
435 if (!tag ||
strcmp(tag,
"-") == 0) {
537 log_debug(
"audio_play_sound('%s', '%s', '%s')",
696 static char buffer[100];
void audio_restart(const char *soundset_name, const char *musicset_name)
static void music_finished_callback(void)
static struct audio_plugin plugins[MAX_NUM_PLUGINS]
void audio_play_track(const char *const tag, char *const alt_tag)
static void real_audio_play_music(const char *const tag, char *const alt_tag, bool keep_old_style)
static bool audio_play_sound_tag(const char *tag, bool repeat)
static enum music_usage current_usage
static int selected_plugin
void audio_play_music(const char *const tag, char *const alt_tag, enum music_usage usage)
static const char * audiospec_fullname(const char *audioset_name, bool music)
void audio_shutdown(bool play_quit_tag)
const char * audio_get_all_plugin_names(void)
void audio_stop_usage(void)
bool audio_select_plugin(const char *const name)
static struct section_file * ss_tagfile
static int audio_play_music_tag(const char *tag, bool repeat, bool keep_old_style)
static const struct strvec * get_audio_speclist(const char *suffix, struct strvec **audio_list)
static bool check_audiofile_capstr(struct section_file *sfile, const char *filename, const char *our_cap, const char *opt_path)
void audio_set_volume(double volume)
const struct strvec * get_musicset_list(const struct option *poption)
void audio_play_sound(const char *const tag, const char *const alt_tag, const char *const alt_tag2)
static int audio_play_tag(struct section_file *sfile, const char *tag, bool repeat, int exclude, bool keep_old_style)
double audio_get_volume(void)
void audio_add_plugin(struct audio_plugin *p)
const struct strvec * get_soundset_list(const struct option *poption)
static bool let_single_track_play
static struct section_file * ms_tagfile
static void audio_shutdown_atexit(void)
static struct mfcb_data mfcb
static int num_plugins_used
const struct strvec * get_soundplugin_list(const struct option *poption)
static bool switching_usage
void audio_real_init(const char *const soundset_name, const char *const musicset_name, const char *const preferred_plugin_name)
void(* audio_finished_callback)(void)
#define MAX_ALT_AUDIO_FILES
void audio_none_init(void)
void audio_sdl_init(void)
bool has_capabilities(const char *us, const char *them)
char sound_plugin_name[512]
#define fc_assert_ret(condition)
#define log_verbose(message,...)
#define log_fatal(message,...)
#define log_debug(message,...)
#define log_normal(message,...)
#define log_error(message,...)
struct section_file * musicspec_load(const char *ms_filename)
void musicspec_close(struct section_file *tagfile)
struct client_options gui_options
struct section_file * secfile_load(const char *filename, bool allow_duplicates)
const char * secfile_error(void)
void secfile_destroy(struct section_file *secfile)
const char * secfile_lookup_str(const struct section_file *secfile, const char *path,...)
const char * fileinfoname(const struct strvec *dirs, const char *filename)
struct strvec * fileinfolist(const struct strvec *dirs, const char *suffix)
const struct strvec * get_data_dirs(void)
bool strvec_set(struct strvec *psv, size_t svindex, const char *string)
void strvec_reserve(struct strvec *psv, size_t reserve)
struct strvec * strvec_new(void)
void(* set_volume)(double volume)
double(* get_volume)(void)
void(* shutdown)(struct audio_plugin *self)
bool sound_enable_menu_music
bool sound_enable_effects
bool sound_enable_game_music
struct section_file * sfile
bool are_support_services_available(void)
#define sz_strlcpy(dest, src)
#define sz_strlcat(dest, src)