UFO: Alien Invasion
s_music.h File Reference

Specifies music API. More...

Include dependency graph for s_music.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  musicStream_t
 

Macros

#define SAMPLE_SIZE   4
 
#define MAX_RAW_SAMPLES   4096 * SAMPLE_SIZE
 

Functions

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. More...
 
void M_StopMusicStream (musicStream_t *userdata)
 
void M_ParseMusic (const char *name, const char **text)
 Parses music definitions for different situations. More...
 
void M_Frame (void)
 
void M_Init (void)
 
void M_Shutdown (void)
 
void M_Stop (void)
 

Detailed Description

Specifies music API.

Definition in file s_music.h.

Macro Definition Documentation

◆ MAX_RAW_SAMPLES

#define MAX_RAW_SAMPLES   4096 * SAMPLE_SIZE

Definition at line 35 of file s_music.h.

◆ SAMPLE_SIZE

#define SAMPLE_SIZE   4

Definition at line 34 of file s_music.h.

Function Documentation

◆ M_AddToSampleBuffer()

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.

Parameters
[in]samplesThe 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]dataThe stereo sample buffer
[in,out]userdataThe music stream
[in]rateThe sample rate

Definition at line 431 of file s_music.cpp.

References data, i, s_env_t::initialized, LittleShort, M_PlayMusicStream(), MAX_RAW_SAMPLES, s_env_t::rate, s_env, musicStream_t::sampleBuf, musicStream_t::samplePos, and scale.

Referenced by CIN_OGM_LoadAudioFrame(), CIN_ROQ_DecodeSoundMono(), and CIN_ROQ_DecodeSoundStereo().

◆ M_Frame()

◆ M_Init()

◆ M_ParseMusic()

void M_ParseMusic ( const char *  name,
const char **  text 
)

Parses music definitions for different situations.

Note
We have lists for geoscape, battlescape, main and aircombat

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().

◆ M_Shutdown()

void M_Shutdown ( void  )

Definition at line 372 of file s_music.cpp.

References Cmd_TableRemoveList(), M_Stop(), and musicCmds.

Referenced by S_Shutdown().

◆ M_Stop()

void M_Stop ( void  )

◆ M_StopMusicStream()