_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <atomic>
#include "stratagus.h"
#include "SDL.h"
#include "sound_server.h"
#include "script.h"
music.cpp - Background music support | |
#define | SoundFrequency 44100 |
static std::atomic_flag | MusicFinishedEventQueued = ATOMIC_FLAG_INIT |
flag is set when a MusicFinishedCallback was enqueued in the event loop and should be handled, and unset when the handler has run. More... | |
static volatile bool | IsCallbackEnabled = false |
static void | CheckMusicFinished () |
static void | MusicFinishedCallback () |
void | InitMusic () |
Initialize music. More... | |
void | CallbackMusicEnable () |
Turn music stopped callback on. More... | |
void | CallbackMusicDisable () |
Skip the next music stopped callback invocation. More... | |
void | CallbackMusicTrigger () |
Turn music stopped callback on and trigger it immediately. More... | |
#define SoundFrequency 44100 |
void CallbackMusicDisable | ( | ) |
Skip the next music stopped callback invocation.
void CallbackMusicEnable | ( | ) |
Turn music stopped callback on.
void CallbackMusicTrigger | ( | ) |
Turn music stopped callback on and trigger it immediately.
|
static |
Check if music is finished and play the next song
void InitMusic | ( | ) |
Initialize music.
Init music
|
static |
Callback for when music has finished Note: we are in the sdl audio thread, so dispatch an event to the main event loop
|
static |
|
static |
flag is set when a MusicFinishedCallback was enqueued in the event loop and should be handled, and unset when the handler has run.