Qt client - fixed downcast of XXX which does not point to an object of type chat_listener
[freeciv.git] / client / audio.h
blob68374cdb10e43251c825c8246daed2294f2d5cc8
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.
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
16 #ifdef __cplusplus
17 extern "C" {
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);
29 struct audio_plugin {
30 char name[MAX_AUDIO_NAME_LEN];
31 char descr[MAX_AUDIO_DESCR_LEN];
32 bool (*init) (void);
33 void (*shutdown) (void);
34 void (*stop) (void);
35 void (*wait) (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 };
44 struct strvec;
45 struct option;
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);
70 #ifdef __cplusplus
72 #endif /* __cplusplus */
74 #endif /* FC__AUDIO_H */