s_music.h File Reference

Specifies music API. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  musicStream_s

Defines

#define SAMPLE_SIZE   4
#define MAX_RAW_SAMPLES   4096 * SAMPLE_SIZE

Typedefs

typedef struct musicStream_s musicStream_t

Functions

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)
void M_ParseMusic (const char *name, const char **text)
 Parses music definitions for different situations.
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.


Define Documentation

#define MAX_RAW_SAMPLES   4096 * SAMPLE_SIZE

Definition at line 34 of file s_music.h.

Referenced by M_AddToSampleBuffer(), and M_MusicStreamCallback().

#define SAMPLE_SIZE   4

Definition at line 33 of file s_music.h.


Typedef Documentation

typedef struct musicStream_s musicStream_t

Function Documentation

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] 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 398 of file s_music.c.

References i, s_env_s::initialized, LittleShort(), MAX_RAW_SAMPLES, s_env_s::rate, s_env, musicStream_s::sampleBuf, musicStream_s::samplePos, and scale.

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

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

Parses music definitions for different situations.

Note:
We can have lists for geoscape and battlescape e.g.

Definition at line 62 of file s_music.c.

References cl_genericPool, Com_EParse(), Com_Parse(), Com_Printf(), FS_SkipBlock(), i, Mem_PoolStrDup, MUSIC_AIRCOMBAT, MUSIC_BATTLESCAPE, MUSIC_GEOSCAPE, MUSIC_MAIN, MUSIC_MAX_ENTRIES, musicArrayLength, and musicArrays.

Referenced by CL_ParseClientData().

void M_PlayMusicStream ( musicStream_t userdata  ) 
void M_Shutdown ( void   ) 

Definition at line 355 of file s_music.c.

References Cmd_RemoveCommand(), and M_Stop().

Referenced by S_Shutdown().

void M_Stop ( void   ) 
void M_StopMusicStream ( musicStream_t userdata  ) 

Definition at line 441 of file s_music.c.

References musicStream_s::playing, music_s::playingStream, and qfalse.

Referenced by CIN_OGM_StopCinematic(), and CIN_ROQ_StopCinematic().


Generated by  doxygen 1.6.2