Freeciv-3.3
|
#include <string.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_mixer.h>
#include "log.h"
#include "support.h"
#include "audio.h"
#include "audio_sdl.h"
Go to the source code of this file.
Data Structures | |
struct | sample |
Functions | |
static void | sdl_audio_set_volume (double volume) |
static double | sdl_audio_get_volume (void) |
static bool | sdl_audio_play (const char *const tag, const char *const fullpath, bool repeat, audio_finished_callback cb) |
static void | sdl_audio_pause (void) |
static void | sdl_audio_resume (void) |
static void | sdl_audio_stop (void) |
static void | sdl_audio_wait (void) |
static void | quit_sdl_audio (void) |
static bool | init_sdl_audio (void) |
static void | sdl_audio_shutdown (struct audio_plugin *self) |
static bool | sdl_audio_init (struct audio_plugin *self) |
void | audio_sdl_init (void) |
Variables | |
const size_t | buf_size = 1024 |
static Mix_Music * | mus = NULL |
static struct sample | samples [MIX_CHANNELS] |
static double | sdl_audio_volume |
Initialize. Note that this function is called very early at the client startup. So for example logging isn't available.
Definition at line 295 of file audio_sdl.c.
Referenced by audio_init().
Init SDL. If the video is already in use (by gui-sdl2), just init the subsystem.
This will need to be changed if SDL is used elsewhere.
Definition at line 210 of file audio_sdl.c.
Referenced by sdl_audio_init().
Quit SDL. If the video is still in use (by gui-sdl2), just quit the subsystem.
This will need to be changed if SDL is used elsewhere.
Definition at line 195 of file audio_sdl.c.
Referenced by sdl_audio_init(), and sdl_audio_shutdown().
|
static |
Set the volume.
Definition at line 63 of file audio_sdl.c.
Referenced by audio_sdl_init(), and sdl_audio_init().
|
static |
Stop music
Definition at line 171 of file audio_sdl.c.
Referenced by audio_sdl_init(), and sdl_audio_shutdown().
Wait for audio to die on all channels. WARNING: If a channel is looping, it will NEVER exit! Always call stop_style_music() first!
Definition at line 182 of file audio_sdl.c.
Referenced by audio_sdl_init(), and sdl_audio_shutdown().
Definition at line 53 of file audio_sdl.c.
Referenced by interpret_tilde(), and sdl_audio_init().
Definition at line 56 of file audio_sdl.c.
Referenced by sdl_audio_play(), and sdl_audio_shutdown().
|
static |
Definition at line 57 of file audio_sdl.c.
Referenced by sdl_audio_init(), sdl_audio_play(), and sdl_audio_shutdown().
|
static |
Definition at line 58 of file audio_sdl.c.
Referenced by audio_sdl_init(), sdl_audio_get_volume(), sdl_audio_init(), sdl_audio_play(), and sdl_audio_set_volume().