Freeciv-3.1
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
audio.h File Reference
#include "support.h"

Go to the source code of this file.

Data Structures

struct  audio_plugin
 

Macros

#define MAX_AUDIO_NAME_LEN   20
 
#define MAX_AUDIO_DESCR_LEN   200
 
#define MAX_ALT_AUDIO_FILES   25
 

Typedefs

typedef void(* audio_finished_callback) (void)
 

Enumerations

enum  music_usage { MU_MENU , MU_INGAME }
 

Functions

const struct strvecget_soundplugin_list (const struct option *poption)
 
const struct strvecget_soundset_list (const struct option *poption)
 
const struct strvecget_musicset_list (const struct option *poption)
 
void audio_init (void)
 
void audio_real_init (const char *const soundspec_name, const char *const musicset_name, const char *const preferred_plugin_name)
 
void audio_add_plugin (struct audio_plugin *p)
 
void audio_shutdown (bool play_quit_tag)
 
void audio_stop (void)
 
void audio_stop_usage (void)
 
void audio_restart (const char *soundset_name, const char *musicset_name)
 
void audio_play_sound (const char *const tag, const char *const alt_tag)
 
void audio_play_music (const char *const tag, char *const alt_tag, enum music_usage usage)
 
void audio_play_track (const char *const tag, char *const alt_tag)
 
double audio_get_volume (void)
 
void audio_set_volume (double volume)
 
bool audio_select_plugin (const char *const name)
 
const char * audio_get_all_plugin_names (void)
 

Macro Definition Documentation

◆ MAX_ALT_AUDIO_FILES

#define MAX_ALT_AUDIO_FILES   25

Definition at line 25 of file audio.h.

◆ MAX_AUDIO_DESCR_LEN

#define MAX_AUDIO_DESCR_LEN   200

Definition at line 23 of file audio.h.

◆ MAX_AUDIO_NAME_LEN

#define MAX_AUDIO_NAME_LEN   20

Definition at line 22 of file audio.h.

Typedef Documentation

◆ audio_finished_callback

typedef void(* audio_finished_callback) (void)

Definition at line 27 of file audio.h.

Enumeration Type Documentation

◆ music_usage

Enumerator
MU_MENU 
MU_INGAME 

Definition at line 43 of file audio.h.

Function Documentation

◆ audio_add_plugin()

void audio_add_plugin ( struct audio_plugin p)

Add a plugin.

Definition at line 135 of file audio.c.

Referenced by audio_none_init(), and audio_sdl_init().

◆ audio_get_all_plugin_names()

const char * audio_get_all_plugin_names ( void  )

Returns a string which list all available plugins. You don't have to free the string.

Definition at line 666 of file audio.c.

Referenced by audio_select_plugin(), and client_main().

◆ audio_get_volume()

double audio_get_volume ( void  )

Get sound volume currently in use.

Definition at line 611 of file audio.c.

◆ audio_init()

void audio_init ( void  )

Initialize base audio system. Note that this function is called very early at the client startup. So for example logging isn't available.

Definition at line 187 of file audio.c.

Referenced by client_main().

◆ audio_play_music()

void audio_play_music ( const char *const  tag,
char *const  alt_tag,
enum music_usage  usage 
)

Loop music as suggested by sound tags

Definition at line 566 of file audio.c.

Referenced by start_menu_music(), and start_style_music().

◆ audio_play_sound()

void audio_play_sound ( const char *const  tag,
const char *const  alt_tag 
)

Play an audio sample as suggested by sound tags

Definition at line 521 of file audio.c.

Referenced by audio_shutdown(), do_move_unit(), handle_city_info(), handle_unit_combat_info(), play_sound_for_event(), and qtg_real_output_window_append().

◆ audio_play_track()

void audio_play_track ( const char *const  tag,
char *const  alt_tag 
)

Play single track as suggested by sound tags

Definition at line 577 of file audio.c.

Referenced by play_single_track().

◆ audio_real_init()

void audio_real_init ( const char *const  soundset_name,
const char *const  musicset_name,
const char *const  preferred_plugin_name 
)

Initialize audio system and autoselect a plugin

Definition at line 273 of file audio.c.

Referenced by audio_restart(), and client_main().

◆ audio_restart()

void audio_restart ( const char *  soundset_name,
const char *  musicset_name 
)

◆ audio_select_plugin()

bool audio_select_plugin ( const char *const  name)

Choose plugin. Returns TRUE on success, FALSE if not

Definition at line 145 of file audio.c.

Referenced by audio_real_init().

◆ audio_set_volume()

void audio_set_volume ( double  volume)

Set sound volume to use.

Definition at line 619 of file audio.c.

◆ audio_shutdown()

void audio_shutdown ( bool  play_quit_tag)

Call this at end of program only.

Parameters
play_quit_tagPlay exit sound

Definition at line 629 of file audio.c.

Referenced by audio_shutdown_atexit(), and client_exit().

◆ audio_stop()

void audio_stop ( void  )

Stop sound. Music should die down in a few seconds.

Definition at line 594 of file audio.c.

Referenced by audio_play_track(), audio_restart(), and audio_shutdown().

◆ audio_stop_usage()

void audio_stop_usage ( void  )

Stop looping sound. Music should die down in a few seconds.

Definition at line 602 of file audio.c.

Referenced by stop_menu_music(), and stop_style_music().

◆ get_musicset_list()

const struct strvec * get_musicset_list ( const struct option poption)

Returns a static string vector of musicsets available on the system.

Definition at line 125 of file audio.c.

◆ get_soundplugin_list()

const struct strvec * get_soundplugin_list ( const struct option poption)

Returns a static string vector of all sound plugins available on the system. This function is unfortunately similar to audio_get_all_plugin_names().

Definition at line 79 of file audio.c.

◆ get_soundset_list()

const struct strvec * get_soundset_list ( const struct option poption)

Returns a static string vector of soundsets available on the system.

Definition at line 115 of file audio.c.