|
UFO: Alien Invasion
|
#include "s_music.h"#include "s_local.h"#include "../cl_shared.h"#include "../../shared/parse.h"#include "../../ports/system.h"#include "../../common/filesys.h"#include "../../common/common.h"#include "../../common/scripts.h"#include "../cl_renderer.h"#include "../cl_video.h"#include "../battlescape/cl_camera.h"#include "../battlescape/cl_localentity.h"#include "../battlescape/cl_battlescape.h"
Go to the source code of this file.
Data Structures | |
| struct | music_t |
Macros | |
| #define | MUSIC_MAX_ENTRIES 64 |
Enumerations | |
| enum | { MUSIC_MAIN , MUSIC_GEOSCAPE , MUSIC_BATTLESCAPE , MUSIC_AIRCOMBAT , MUSIC_MAX } |
Functions | |
| void | M_ParseMusic (const char *name, const char **text) |
| Parses music definitions for different situations. | |
| void | M_Stop (void) |
| static void | M_Start (const char *file) |
| static void | M_Play_f (void) |
| Plays the music file given via commandline parameter. | |
| static void | M_RandomTrack_f (void) |
| Sets the music cvar to a random track. | |
| static bool | M_PlayRandomByCategory (int category) |
| static void | M_Change_f (void) |
| Changes the music if it suits the current situation. | |
| static int | M_CompleteMusic (const char *partial, const char **match) |
| static void | M_MusicStreamUpdate (void) |
| void | M_Frame (void) |
| void | M_Init (void) |
| void | M_Shutdown (void) |
| static void | M_MusicStreamCallback (musicStream_t *userdata, byte *stream, int length) |
| static void | M_PlayMusicStream (musicStream_t *userdata) |
| void | M_AddToSampleBuffer (musicStream_t *userdata, int rate, int samples, const byte *data) |
| Add stereo samples with a 16 byte width to the stream buffer. | |
| void | M_StopMusicStream (musicStream_t *userdata) |
Variables | |
| static char * | musicArrays [MUSIC_MAX][MUSIC_MAX_ENTRIES] = {{}, {}} |
| static int | musicArrayLength [MUSIC_MAX] = {} |
| static music_t | music = {{}, {}, nullptr, 0, nullptr, false, false, true} |
| static cvar_t * | snd_music |
| static cvar_t * | snd_music_volume |
| static cvar_t * | snd_music_play |
| static const cmdList_t | musicCmds [] |
| #define MUSIC_MAX_ENTRIES 64 |
Definition at line 61 of file s_music.cpp.
Referenced by M_ParseMusic().
| anonymous enum |
| Enumerator | |
|---|---|
| MUSIC_MAIN | |
| MUSIC_GEOSCAPE | |
| MUSIC_BATTLESCAPE | |
| MUSIC_AIRCOMBAT | |
| MUSIC_MAX | |
Definition at line 39 of file s_music.cpp.
| void M_AddToSampleBuffer | ( | musicStream_t * | userdata, |
| int | rate, | ||
| int | samples, | ||
| const byte * | data ) |
Add stereo samples with a 16 byte width to the stream buffer.
| [in] | samples | The amount of stereo samples that should be added to the stream buffer (this is usually 1/4 of the size of the data buffer, one sample should have 4 bytes, 2 for each channel) |
| [in] | data | The stereo sample buffer |
| [in,out] | userdata | The music stream |
| [in] | rate | The sample rate |
Definition at line 428 of file s_music.cpp.
References data, i, LittleShort, M_PlayMusicStream(), MAX_RAW_SAMPLES, s_env, musicStream_t::sampleBuf, musicStream_t::samplePos, and scale.
Referenced by CIN_OGM_LoadAudioFrame(), CIN_ROQ_DecodeSoundMono(), and CIN_ROQ_DecodeSoundStereo().
Changes the music if it suits the current situation.
Definition at line 256 of file s_music.cpp.
References CL_OnBattlescape(), Cmd_Argc(), Cmd_Argv(), Com_DPrintf(), Com_Printf(), DEBUG_SOUND, M_PlayRandomByCategory(), music, MUSIC_AIRCOMBAT, MUSIC_BATTLESCAPE, MUSIC_GEOSCAPE, MUSIC_MAIN, musicArrayLength, Q_streq, s_env, and type.
|
static |
Definition at line 293 of file s_music.cpp.
References Cmd_GenericCompleteFunction(), Com_Printf(), and FS_NextFileFromFileList().
Referenced by M_Init().
Definition at line 314 of file s_music.cpp.
References M_MusicStreamUpdate(), M_PlayRandomByCategory(), M_Start(), M_Stop(), music, Q_strvalid, snd_music, snd_music_play, and snd_music_volume.
Referenced by S_Frame().
Definition at line 356 of file s_music.cpp.
References Cmd_AddParamCompleteFunction(), Cmd_Exists(), Cmd_RemoveCommand(), Cmd_TableAddList(), CVAR_ARCHIVE, Cvar_Get(), M_CompleteMusic(), music, musicCmds, snd_music, snd_music_play, and snd_music_volume.
Referenced by S_Init().
|
static |
Definition at line 376 of file s_music.cpp.
References length, MAX_RAW_SAMPLES, musicStream_t::mixerPos, music, musicStream_t::playing, musicStream_t::sampleBuf, musicStream_t::samplePos, and Sys_Sleep().
Referenced by M_PlayMusicStream().
Definition at line 306 of file s_music.cpp.
References M_StopMusicStream(), and music.
Referenced by M_Frame().
| void M_ParseMusic | ( | const char * | name, |
| const char ** | text ) |
Parses music definitions for different situations.
Definition at line 73 of file s_music.cpp.
References cl_genericPool, Com_Error(), Com_ParseList(), Com_Printf(), ERR_DROP, i, LIST_Delete(), Mem_PoolStrDup, MUSIC_AIRCOMBAT, MUSIC_BATTLESCAPE, MUSIC_GEOSCAPE, MUSIC_MAIN, MUSIC_MAX_ENTRIES, musicArrayLength, musicArrays, name, linkedList_t::next, and Q_streq.
Referenced by CL_ParseClientData().
Plays the music file given via commandline parameter.
Definition at line 203 of file s_music.cpp.
References Cmd_Argc(), Cmd_Argv(), Cvar_GetString(), Cvar_Set(), and M_Start().
|
static |
Definition at line 407 of file s_music.cpp.
References M_MusicStreamCallback(), M_Stop(), music, and musicStream_t::playing.
Referenced by M_AddToSampleBuffer().
|
static |
Definition at line 239 of file s_music.cpp.
References CL_OnBattlescape(), Com_Printf(), Cvar_Set(), music, MUSIC_BATTLESCAPE, musicArrayLength, musicArrays, and snd_music.
Referenced by M_Change_f(), and M_Frame().
Sets the music cvar to a random track.
Definition at line 214 of file s_music.cpp.
References Com_DPrintf(), Com_Printf(), Com_SkipPath(), Cvar_Set(), DEBUG_SOUND, FS_BuildFileList(), FS_NextFileFromFileList(), music, and s_env.
Definition at line 369 of file s_music.cpp.
References Cmd_TableRemoveList(), M_Stop(), and musicCmds.
Referenced by S_Shutdown().
|
static |
Definition at line 135 of file s_music.cpp.
References Com_Printf(), Com_StripExtension(), FS_FreeFile(), FS_LoadFile(), len, M_Stop(), MAX_QPATH, music, name, Q_streq, Q_strncpyz(), Q_strnull(), s_env, UFO_SIZE_T, and va().
Referenced by M_Frame(), and M_Play_f().
Definition at line 114 of file s_music.cpp.
References FS_FreeFile(), and music.
Referenced by M_Frame(), M_PlayMusicStream(), M_Shutdown(), and M_Start().
| void M_StopMusicStream | ( | musicStream_t * | userdata | ) |
Definition at line 462 of file s_music.cpp.
References music, and musicStream_t::playing.
Referenced by CIN_OGM_CloseCinematic(), CIN_ROQ_CloseCinematic(), and M_MusicStreamUpdate().
Definition at line 64 of file s_music.cpp.
Referenced by M_Change_f(), M_Frame(), M_Init(), M_MusicStreamCallback(), M_MusicStreamUpdate(), M_PlayMusicStream(), M_PlayRandomByCategory(), M_RandomTrack_f(), M_Start(), M_Stop(), and M_StopMusicStream().
Definition at line 63 of file s_music.cpp.
Referenced by M_Change_f(), M_ParseMusic(), and M_PlayRandomByCategory().
|
static |
Definition at line 62 of file s_music.cpp.
Referenced by M_ParseMusic(), and M_PlayRandomByCategory().
|
static |
Definition at line 348 of file s_music.cpp.
Referenced by M_Init(), and M_Shutdown().
|
static |
Definition at line 65 of file s_music.cpp.
Referenced by M_Frame(), M_Init(), and M_PlayRandomByCategory().
|
static |
Definition at line 67 of file s_music.cpp.
|
static |
Definition at line 66 of file s_music.cpp.