Freeciv-3.3
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_pause (void)
 
void audio_resume (void)
 
void audio_play_sound (const char *const tag, const char *const alt_tag, const char *const alt_tag2)
 
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 charaudio_get_all_plugin_names (void)
 

Macro Definition Documentation

◆ MAX_ALT_AUDIO_FILES

#define MAX_ALT_AUDIO_FILES   25

Definition at line 26 of file audio.h.

◆ MAX_AUDIO_DESCR_LEN

#define MAX_AUDIO_DESCR_LEN   200

Definition at line 24 of file audio.h.

◆ MAX_AUDIO_NAME_LEN

#define MAX_AUDIO_NAME_LEN   20

Definition at line 23 of file audio.h.

Typedef Documentation

◆ audio_finished_callback

typedef void(* audio_finished_callback) (void)

Definition at line 28 of file audio.h.

Enumeration Type Documentation

◆ music_usage

Enumerator
MU_MENU 
MU_INGAME 

Definition at line 46 of file audio.h.

Function Documentation

◆ audio_add_plugin()

void audio_add_plugin ( struct audio_plugin p)

Add a plugin.

Definition at line 136 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 694 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 639 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 188 of file audio.c.

Referenced by client_main().

◆ audio_pause()

void audio_pause ( void  )

Pause sound.

Definition at line 606 of file audio.c.

Referenced by timer_callback().

◆ 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 578 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,
const char *const  alt_tag2 
)

◆ 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 589 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 274 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_resume()

void audio_resume ( void  )

Resume sound.

Definition at line 614 of file audio.c.

Referenced by timer_callback().

◆ audio_select_plugin()

bool audio_select_plugin ( const char *const  name)

Choose plugin. Returns TRUE on success, FALSE if not

Definition at line 146 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 647 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 657 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 622 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 630 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 126 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 80 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 116 of file audio.c.