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)
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 ***********************************************************************/
18 #endif /* __cplusplus */
20 #include "support.h" /* bool type */
22 #define MAX_AUDIO_NAME_LEN 20
23 #define MAX_AUDIO_DESCR_LEN 200
25 #define MAX_ALT_AUDIO_FILES 5
27 typedef void (*audio_finished_callback
)(void);
30 char name
[MAX_AUDIO_NAME_LEN
];
31 char descr
[MAX_AUDIO_DESCR_LEN
];
33 void (*shutdown
) (void);
36 double (*get_volume
) (void);
37 void (*set_volume
) (double volume
);
38 bool (*play
) (const char *const tag
, const char *const path
, bool repeat
,
39 audio_finished_callback cb
);
42 enum music_usage
{ MU_SINGLE
, MU_MENU
, MU_INGAME
};
46 const struct strvec
*get_soundplugin_list(const struct option
*poption
);
47 const struct strvec
*get_soundset_list(const struct option
*poption
);
48 const struct strvec
*get_musicset_list(const struct option
*poption
);
50 void audio_init(void);
51 void audio_real_init(const char *const soundspec_name
,
52 const char *const musicset_name
,
53 const char *const preferred_plugin_name
);
54 void audio_add_plugin(struct audio_plugin
*p
);
55 void audio_shutdown(void);
56 void audio_stop(void);
57 void audio_restart(const char *soundset_name
, const char *musicset_name
);
59 void audio_play_sound(const char *const tag
, char *const alt_tag
);
60 void audio_play_music(const char *const tag
, char *const alt_tag
,
61 enum music_usage usage
);
62 void audio_play_track(const char *const tag
, char *const alt_tag
);
64 double audio_get_volume(void);
65 void audio_set_volume(double volume
);
67 bool audio_select_plugin(const char *const name
);
68 const char *audio_get_all_plugin_names(void);
72 #endif /* __cplusplus */
74 #endif /* FC__AUDIO_H */