Freeciv-3.2
Loading...
Searching...
No Matches
audio.h
Go to the documentation of this file.
1/***********************************************************************
2 Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12***********************************************************************/
13#ifndef FC__AUDIO_H
14#define FC__AUDIO_H
15
16#ifdef __cplusplus
17extern "C" {
18#endif /* __cplusplus */
19
20/* utility */
21#include "support.h" /* bool type */
22
23#define MAX_AUDIO_NAME_LEN 20
24#define MAX_AUDIO_DESCR_LEN 200
25
26#define MAX_ALT_AUDIO_FILES 25
27
29
34 bool (*init) (struct audio_plugin *self);
39 void (*set_volume) (double volume);
40 bool (*play) (const char *const tag, const char *const path, bool repeat,
44};
45
47
48struct strvec;
49struct option;
50const struct strvec *get_soundplugin_list(const struct option *poption);
51const struct strvec *get_soundset_list(const struct option *poption);
52const struct strvec *get_musicset_list(const struct option *poption);
53
54void audio_init(void);
55void audio_real_init(const char *const soundspec_name,
56 const char *const musicset_name,
57 const char *const preferred_plugin_name);
58void audio_add_plugin(struct audio_plugin *p);
60void audio_stop(void);
61void audio_stop_usage(void);
62void audio_restart(const char *soundset_name, const char *musicset_name);
63
64void audio_pause(void);
65void audio_resume(void);
66
67void audio_play_sound(const char *const tag, const char *const alt_tag,
68 const char *const alt_tag2);
69void audio_play_music(const char *const tag, char *const alt_tag,
70 enum music_usage usage);
71void audio_play_track(const char *const tag, char *const alt_tag);
72
73double audio_get_volume(void);
74void audio_set_volume(double volume);
75
76bool audio_select_plugin(const char *const name);
77const char *audio_get_all_plugin_names(void);
78
79#ifdef __cplusplus
80}
81#endif /* __cplusplus */
82
83#endif /* FC__AUDIO_H */
void audio_restart(const char *soundset_name, const char *musicset_name)
Definition audio.c:376
void audio_pause(void)
Definition audio.c:606
void audio_play_track(const char *const tag, char *const alt_tag)
Definition audio.c:589
void audio_resume(void)
Definition audio.c:614
void audio_play_music(const char *const tag, char *const alt_tag, enum music_usage usage)
Definition audio.c:578
void audio_shutdown(bool play_quit_tag)
Definition audio.c:657
const char * audio_get_all_plugin_names(void)
Definition audio.c:694
void audio_stop(void)
Definition audio.c:622
void audio_stop_usage(void)
Definition audio.c:630
void audio_init(void)
Definition audio.c:188
music_usage
Definition audio.h:46
@ MU_INGAME
Definition audio.h:46
@ MU_MENU
Definition audio.h:46
bool audio_select_plugin(const char *const name)
Definition audio.c:146
void audio_real_init(const char *const soundspec_name, const char *const musicset_name, const char *const preferred_plugin_name)
Definition audio.c:274
void audio_set_volume(double volume)
Definition audio.c:647
const struct strvec * get_musicset_list(const struct option *poption)
Definition audio.c:126
#define MAX_AUDIO_NAME_LEN
Definition audio.h:23
void audio_play_sound(const char *const tag, const char *const alt_tag, const char *const alt_tag2)
Definition audio.c:528
double audio_get_volume(void)
Definition audio.c:639
void(* audio_finished_callback)(void)
Definition audio.h:28
void audio_add_plugin(struct audio_plugin *p)
Definition audio.c:136
const struct strvec * get_soundset_list(const struct option *poption)
Definition audio.c:116
#define MAX_AUDIO_DESCR_LEN
Definition audio.h:24
const struct strvec * get_soundplugin_list(const struct option *poption)
Definition audio.c:80
static struct ai_type * self
Definition classicai.c:45
char * incite_cost
Definition comments.c:75
const char * name
Definition inputfile.c:127
char descr[MAX_AUDIO_DESCR_LEN]
Definition audio.h:32
void(* resume)(void)
Definition audio.h:43
bool(* init)(struct audio_plugin *self)
Definition audio.h:34
void(* stop)(void)
Definition audio.h:36
void(* wait)(void)
Definition audio.h:37
bool initialized
Definition audio.h:33
void(* set_volume)(double volume)
Definition audio.h:39
double(* get_volume)(void)
Definition audio.h:38
void(* shutdown)(struct audio_plugin *self)
Definition audio.h:35
bool(* play)(const char *const tag, const char *const path, bool repeat, audio_finished_callback cb)
Definition audio.h:40
void(* pause)(void)
Definition audio.h:42
char name[MAX_AUDIO_NAME_LEN]
Definition audio.h:31
#define bool
Definition support.h:71