UFO: Alien Invasion
Loading...
Searching...
No Matches
s_music.h
Go to the documentation of this file.
1
5
6/*
7All original material Copyright (C) 2002-2025 UFO: Alien Invasion.
8
9Original file from Quake 2 v3.21: quake2-2.31/client/sound.h
10Copyright (C) 1997-2001 Id Software, Inc.
11
12This program is free software; you can redistribute it and/or
13modify it under the terms of the GNU General Public License
14as published by the Free Software Foundation; either version 2
15of the License, or (at your option) any later version.
16
17This program is distributed in the hope that it will be useful,
18but WITHOUT ANY WARRANTY; without even the implied warranty of
19MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
21See the GNU General Public License for more details.
22
23You should have received a copy of the GNU General Public License
24along with this program; if not, write to the Free Software
25Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
27*/
28
29#pragma once
30
31#include "../../shared/ufotypes.h" /* for bool & byte */
32
33/* 2 channels and a width of 2 bytes (short) */
34#define SAMPLE_SIZE 4
35#define MAX_RAW_SAMPLES 4096 * SAMPLE_SIZE
36
37typedef struct musicStream_s {
38 bool playing;
43
44void M_AddToSampleBuffer(musicStream_t* userdata, int rate, int samples, const byte* data);
45void M_StopMusicStream(musicStream_t* userdata);
46void M_ParseMusic(const char* name, const char** text);
47void M_Frame(void);
48void M_Init(void);
49void M_Shutdown(void);
50void M_Stop(void);
QGL_EXTERN GLsizei const GLvoid * data
Definition r_gl.h:89
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition r_gl.h:110
#define MAX_RAW_SAMPLES
Definition s_music.h:35
void M_StopMusicStream(musicStream_t *userdata)
Definition s_music.cpp:462
void M_Stop(void)
Definition s_music.cpp:114
void M_Init(void)
Definition s_music.cpp:356
void M_Frame(void)
Definition s_music.cpp:314
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.
Definition s_music.cpp:428
void M_ParseMusic(const char *name, const char **text)
Parses music definitions for different situations.
Definition s_music.cpp:73
void M_Shutdown(void)
Definition s_music.cpp:369
bool playing
Definition s_music.h:38
int samplePos
Definition s_music.h:41
byte sampleBuf[MAX_RAW_SAMPLES]
Definition s_music.h:39
Cross-platform type definitions.