Freeciv21
Develop your civilization from humble roots to a global empire
audio.h File Reference
#include <QVector>
+ Include dependency graph for audio.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  audio_plugin
 

Typedefs

typedef void(* audio_finished_callback) ()
 

Enumerations

enum  music_usage { MU_MENU , MU_INGAME }
 

Functions

const QVector< QString > * get_soundplugin_list (const struct option *poption)
 Returns a static string vector of all sound plugins available on the system. More...
 
const QVector< QString > * get_soundset_list (const struct option *poption)
 Returns a static string vector of soundsets available on the system. More...
 
const QVector< QString > * get_musicset_list (const struct option *poption)
 Returns a static string vector of musicsets available on the system. More...
 
void audio_init ()
 Initialize base audio system. More...
 
void audio_real_init (const QString &soundspec_name, const QString &musicset_name, const QString &preferred_plugin_name)
 Initialize audio system and autoselect a plugin. More...
 
void audio_add_plugin (struct audio_plugin *p)
 Add a plugin. More...
 
void audio_shutdown ()
 Call this at end of program only. More...
 
void audio_stop ()
 Stop sound. More...
 
void audio_stop_usage ()
 Stop looping sound. More...
 
void audio_restart (const QString &soundset_name, const QString &musicset_name)
 Switch soundset. More...
 
void audio_play_sound (const QString &tag, const QString &alt_tag)
 Play an audio sample as suggested by sound tags. More...
 
void audio_play_music (const QString &tag, const QString &alt_tag, enum music_usage usage)
 Loop music as suggested by sound tags. More...
 
void audio_play_track (const QString &tag, const QString &alt_tag)
 Play single track as suggested by sound tags. More...
 
double audio_get_volume ()
 Get sound volume currently in use. More...
 
void audio_set_volume (double volume)
 Set sound volume to use. More...
 
bool audio_select_plugin (const QString &name)
 Choose plugin. More...
 
const QString audio_get_all_plugin_names ()
 Returns a string which list all available plugins. More...
 

Typedef Documentation

◆ audio_finished_callback

typedef void(* audio_finished_callback) ()

Definition at line 17 of file audio.h.

Enumeration Type Documentation

◆ music_usage

Enumerator
MU_MENU 
MU_INGAME 

Definition at line 33 of file audio.h.

Function Documentation

◆ audio_add_plugin()

void audio_add_plugin ( struct audio_plugin p)

Add a plugin.

Definition at line 108 of file audio.cpp.

Referenced by audio_none_init(), and audio_sdl_init().

◆ audio_get_all_plugin_names()

const QString audio_get_all_plugin_names ( )

Returns a string which list all available plugins.

You don't have to free the string.

Definition at line 630 of file audio.cpp.

Referenced by audio_select_plugin().

◆ audio_get_volume()

double audio_get_volume ( )

Get sound volume currently in use.

Definition at line 586 of file audio.cpp.

Referenced by audio_none_init().

◆ audio_init()

void audio_init ( )

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 173 of file audio.cpp.

Referenced by client_main().

◆ audio_play_music()

void audio_play_music ( const QString &  tag,
const QString &  alt_tag,
enum music_usage  usage 
)

Loop music as suggested by sound tags.

Definition at line 544 of file audio.cpp.

Referenced by start_menu_music(), and start_style_music().

◆ audio_play_sound()

void audio_play_sound ( const QString &  tag,
const QString &  alt_tag 
)

Play an audio sample as suggested by sound tags.

Definition at line 494 of file audio.cpp.

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

◆ audio_play_track()

void audio_play_track ( const QString &  tag,
const QString &  alt_tag 
)

Play single track as suggested by sound tags.

Definition at line 555 of file audio.cpp.

Referenced by play_single_track().

◆ audio_real_init()

void audio_real_init ( const QString &  soundspec_name,
const QString &  musicset_name,
const QString &  preferred_plugin_name 
)

Initialize audio system and autoselect a plugin.

Definition at line 253 of file audio.cpp.

Referenced by audio_restart(), and client_main().

◆ audio_restart()

void audio_restart ( const QString &  soundset_name,
const QString &  musicset_name 
)

◆ audio_select_plugin()

bool audio_select_plugin ( const QString &  name)

Choose plugin.

Returns TRUE on success, FALSE if not

Definition at line 126 of file audio.cpp.

Referenced by audio_real_init().

◆ audio_set_volume()

void audio_set_volume ( double  volume)

Set sound volume to use.

Definition at line 591 of file audio.cpp.

Referenced by audio_none_init(), and sound_volume_callback().

◆ audio_shutdown()

void audio_shutdown ( )

Call this at end of program only.

Definition at line 599 of file audio.cpp.

Referenced by audio_real_init(), and client_exit().

◆ audio_stop()

void audio_stop ( )

Stop sound.

Music should die down in a few seconds.

Definition at line 572 of file audio.cpp.

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

◆ audio_stop_usage()

void audio_stop_usage ( )

Stop looping sound.

Music should die down in a few seconds.

Definition at line 577 of file audio.cpp.

Referenced by stop_menu_music(), and stop_style_music().

◆ get_musicset_list()

const QVector<QString>* get_musicset_list ( const struct option poption)

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

Definition at line 96 of file audio.cpp.

Referenced by init_client_options().

◆ get_soundplugin_list()

const QVector<QString>* 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 70 of file audio.cpp.

Referenced by init_client_options().

◆ get_soundset_list()

const QVector<QString>* get_soundset_list ( const struct option poption)

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

Definition at line 84 of file audio.cpp.

Referenced by init_client_options().