UFO: Alien Invasion
s_music.h
Go to the documentation of this file.
1
6
/*
7
All original material Copyright (C) 2002-2022 UFO: Alien Invasion.
8
9
Original file from Quake 2 v3.21: quake2-2.31/client/sound.h
10
Copyright (C) 1997-2001 Id Software, Inc.
11
12
This program is free software; you can redistribute it and/or
13
modify it under the terms of the GNU General Public License
14
as published by the Free Software Foundation; either version 2
15
of the License, or (at your option) any later version.
16
17
This program is distributed in the hope that it will be useful,
18
but WITHOUT ANY WARRANTY; without even the implied warranty of
19
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20
21
See the GNU General Public License for more details.
22
23
You should have received a copy of the GNU General Public License
24
along with this program; if not, write to the Free Software
25
Foundation, 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
37
typedef
struct
musicStream_s {
38
bool
playing
;
39
byte
sampleBuf[
MAX_RAW_SAMPLES
];
40
int
mixerPos
;
41
int
samplePos
;
42
}
musicStream_t
;
43
44
void
M_AddToSampleBuffer
(
musicStream_t
* userdata,
int
rate,
int
samples,
const
byte
*
data
);
45
void
M_StopMusicStream
(
musicStream_t
* userdata);
46
void
M_ParseMusic
(
const
char
*
name
,
const
char
** text);
47
void
M_Frame
(
void
);
48
void
M_Init
(
void
);
49
void
M_Shutdown
(
void
);
50
void
M_Stop
(
void
);
data
QGL_EXTERN GLsizei const GLvoid * data
Definition:
r_gl.h:89
name
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Definition:
r_gl.h:110
MAX_RAW_SAMPLES
#define MAX_RAW_SAMPLES
Definition:
s_music.h:35
M_StopMusicStream
void M_StopMusicStream(musicStream_t *userdata)
Definition:
s_music.cpp:465
M_Stop
void M_Stop(void)
Definition:
s_music.cpp:114
M_Init
void M_Init(void)
Definition:
s_music.cpp:359
M_Frame
void M_Frame(void)
Definition:
s_music.cpp:317
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.
Definition:
s_music.cpp:431
M_ParseMusic
void M_ParseMusic(const char *name, const char **text)
Parses music definitions for different situations.
Definition:
s_music.cpp:73
M_Shutdown
void M_Shutdown(void)
Definition:
s_music.cpp:372
musicStream_t
Definition:
s_music.h:37
musicStream_t::playing
bool playing
Definition:
s_music.h:38
musicStream_t::mixerPos
int mixerPos
Definition:
s_music.h:40
musicStream_t::samplePos
int samplePos
Definition:
s_music.h:41
src
client
sound
s_music.h
Generated on Tue Jul 19 2022 00:00:00 for UFO: Alien Invasion by
1.9.4