orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
orxSoundSystem.h
Go to the documentation of this file.
1/* Orx - Portable Game Engine
2 *
3 * Copyright (c) 2008- Orx-Project
4 *
5 * This software is provided 'as-is', without any express or implied
6 * warranty. In no event will the authors be held liable for any damages
7 * arising from the use of this software.
8 *
9 * Permission is granted to anyone to use this software for any purpose,
10 * including commercial applications, and to alter it and redistribute it
11 * freely, subject to the following restrictions:
12 *
13 * 1. The origin of this software must not be misrepresented; you must not
14 * claim that you wrote the original software. If you use this software
15 * in a product, an acknowledgment in the product documentation would be
16 * appreciated but is not required.
17 *
18 * 2. Altered source versions must be plainly marked as such, and must not be
19 * misrepresented as being the original software.
20 *
21 * 3. This notice may not be removed or altered from any source
22 * distribution.
23 */
24
32
41
42
43#ifndef _orxSOUNDSYSTEM_H_
44#define _orxSOUNDSYSTEM_H_
45
46#include "orxInclude.h"
47#include "math/orxVector.h"
49
50
51/***************************************************************************
52 * Structure declaration *
53 ***************************************************************************/
54
57typedef struct __orxSOUNDSYSTEM_SOUND_t orxSOUNDSYSTEM_SOUND;
58typedef struct __orxSOUNDSYSTEM_SAMPLE_t orxSOUNDSYSTEM_SAMPLE;
59
86
100
121
124typedef void (orxFASTCALL *orxSOUND_FILTER_FUNCTION)(orxFLOAT *_afSampleListOut, const orxFLOAT *_afSampleListIn, orxU32 _u32SampleCount, orxU32 _u32ChannelCount, orxU32 _u32SampleRate, orxSTRINGID _stNameID, void *_pContext);
125
128typedef struct __orxSOUND_FILTER_DATA_t
129{
131 orxSTRINGID stNameID;
132
133 union
134 {
135 struct
136 {
137 orxFLOAT fA0;
138 orxFLOAT fA1;
139 orxFLOAT fA2;
140 orxFLOAT fB0;
141 orxFLOAT fB1;
142 orxFLOAT fB2;
143
144 } stBiquad;
145
146 struct
147 {
148 orxFLOAT fFrequency;
149 orxU32 u32Order;
150
151 } stLowPass;
152
153 struct
154 {
155 orxFLOAT fFrequency;
156 orxU32 u32Order;
157
158 } stHighPass;
159
160 struct
161 {
162 orxFLOAT fFrequency;
163 orxU32 u32Order;
164
165 } stBandPass;
166
167 struct
168 {
169 orxFLOAT fFrequency;
170 orxFLOAT fQ;
171 orxFLOAT fGain;
172
173 } stLowShelf;
174
175 struct
176 {
177 orxFLOAT fFrequency;
178 orxFLOAT fQ;
179 orxFLOAT fGain;
180
181 } stHighShelf;
182
183 struct
184 {
185 orxFLOAT fFrequency;
186 orxFLOAT fQ;
187
188 } stNotch;
189
190 struct
191 {
192 orxFLOAT fFrequency;
193 orxFLOAT fQ;
194 orxFLOAT fGain;
195
196 } stPeaking;
197
198 struct
199 {
200 orxFLOAT fDelay;
201 orxFLOAT fDecay;
202
203 } stDelay;
204
205 struct
206 {
208 void *pContext;
209
210 } stCustom;
211
212 };
213
215
218#define orxSOUNDSYSTEM_KZ_CONFIG_SECTION "SoundSystem"
219#define orxSOUNDSYSTEM_KZ_CONFIG_RATIO "DimensionRatio"
220#define orxSOUNDSYSTEM_KZ_CONFIG_MUTE_IN_BACKGROUND "MuteInBackground"
221#define orxSOUNDSYSTEM_KZ_CONFIG_LISTENERS "Listeners"
222#define orxSOUNDSYSTEM_KZ_CONFIG_CHANNELS "Channels"
223
224
225/***************************************************************************
226 * Functions directly implemented by orx core
227 ***************************************************************************/
228
231extern orxDLLAPI void orxFASTCALL orxSoundSystem_Setup();
232
233
234/***************************************************************************
235 * Functions extended by plugins
236 ***************************************************************************/
237
242
245extern orxDLLAPI void orxFASTCALL orxSoundSystem_Exit();
246
253extern orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate);
254
259extern orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_LoadSample(const orxSTRING _zFilename);
260
266
274extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetSampleInfo(const orxSOUNDSYSTEM_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate);
275
282extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetSampleData(orxSOUNDSYSTEM_SAMPLE *_pstSample, const orxFLOAT *_afData, orxU32 _u32SampleNumber);
283
290
298extern orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateStream(orxHANDLE _hUserData, orxSOUNDSYSTEM_STREAM_TYPE _eType, orxU32 _u32ChannelNumber, orxU32 _u32SampleRate);
299
305extern orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_LoadStream(orxHANDLE _hUserData, const orxSTRING _zFilename);
306
312
318
324
330
337extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_AddFilter(orxSOUNDSYSTEM_SOUND *_pstSound, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam);
338
344
350
355extern orxDLLAPI orxHANDLE orxFASTCALL orxSoundSystem_CreateBus(orxSTRINGID _stBusID);
356
362
369
376
383extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_AddBusFilter(orxHANDLE _hBus, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam);
384
390
396
404extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber);
405
410
415
421extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetVolume(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fVolume);
422
428extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPitch(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fPitch);
429
435extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetTime(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fTime);
436
442extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPosition(orxSOUNDSYSTEM_SOUND *_pstSound, const orxVECTOR *_pvPosition);
443
453extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetSpatialization(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fMinDistance, orxFLOAT _fMaxDistance, orxFLOAT _fMinGain, orxFLOAT _fMaxGain, orxFLOAT _fRollOff);
454
461extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPanning(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fPanning, orxBOOL _bMix);
462
468extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Loop(orxSOUNDSYSTEM_SOUND *_pstSound, orxBOOL _bLoop);
469
474extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetVolume(const orxSOUNDSYSTEM_SOUND *_pstSound);
475
480extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetPitch(const orxSOUNDSYSTEM_SOUND *_pstSound);
481
486extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetTime(const orxSOUNDSYSTEM_SOUND *_pstSound);
487
493extern orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetPosition(const orxSOUNDSYSTEM_SOUND *_pstSound, orxVECTOR *_pvPosition);
494
504extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetSpatialization(const orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT *_pfMinDistance, orxFLOAT *_pfMaxDistance, orxFLOAT *_pfMinGain, orxFLOAT *_pfMaxGain, orxFLOAT *_pfRollOff);
505
512extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetPanning(const orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT *_pfPanning, orxBOOL *_pbMix);
513
518extern orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_IsLooping(const orxSOUNDSYSTEM_SOUND *_pstSound);
519
524extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetDuration(const orxSOUNDSYSTEM_SOUND *_pstSound);
525
531
536extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetGlobalVolume(orxFLOAT _fGlobalVolume);
537
541extern orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetGlobalVolume();
542
546extern orxDLLAPI orxU32 orxFASTCALL orxSoundSystem_GetListenerCount();
547
552extern orxDLLAPI void orxFASTCALL orxSoundSystem_EnableListener(orxU32 _u32ListenerIndex, orxBOOL _bEnable);
553
558extern orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_IsListenerEnabled(orxU32 _u32ListenerIndex);
559
565extern orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetListenerPosition(orxU32 _u32Index, const orxVECTOR *_pvPosition);
566
572extern orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetListenerPosition(orxU32 _u32Index, orxVECTOR *_pvPosition);
573
574#endif /* _orxSOUNDSYSTEM_H_ */
575
#define orxDLLAPI
Definition orxDecl.h:381
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_AddBusFilter(orxHANDLE _hBus, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam)
orxSOUNDSYSTEM_STATUS
orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetPosition(const orxSOUNDSYSTEM_SOUND *_pstSound, orxVECTOR *_pvPosition)
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate)
void(orxFASTCALL * orxSOUND_FILTER_FUNCTION)(orxFLOAT *_afSampleListOut, const orxFLOAT *_afSampleListIn, orxU32 _u32SampleCount, orxU32 _u32ChannelCount, orxU32 _u32SampleRate, orxSTRINGID _stNameID, void *_pContext)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Play(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StopRecording()
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_HasRecordingSupport()
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Init()
orxDLLAPI orxVECTOR *orxFASTCALL orxSoundSystem_GetListenerPosition(orxU32 _u32Index, orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPitch(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fPitch)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber)
orxDLLAPI orxSOUNDSYSTEM_STATUS orxFASTCALL orxSoundSystem_GetStatus(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_AddFilter(orxSOUNDSYSTEM_SOUND *_pstSound, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam)
orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateStream(orxHANDLE _hUserData, orxSOUNDSYSTEM_STREAM_TYPE _eType, orxU32 _u32ChannelNumber, orxU32 _u32SampleRate)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetPanning(const orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT *_pfPanning, orxBOOL *_pbMix)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetSampleData(orxSOUNDSYSTEM_SAMPLE *_pstSample, const orxFLOAT *_afData, orxU32 _u32SampleNumber)
orxDLLAPI void orxFASTCALL orxSoundSystem_Setup()
orxSOUND_FILTER_TYPE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPanning(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fPanning, orxBOOL _bMix)
struct __orxSOUNDSYSTEM_SAMPLE_t orxSOUNDSYSTEM_SAMPLE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetPosition(orxSOUNDSYSTEM_SOUND *_pstSound, const orxVECTOR *_pvPosition)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetGlobalVolume()
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetSpatialization(const orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT *_pfMinDistance, orxFLOAT *_pfMaxDistance, orxFLOAT *_pfMinGain, orxFLOAT *_pfMaxGain, orxFLOAT *_pfRollOff)
orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_LoadStream(orxHANDLE _hUserData, const orxSTRING _zFilename)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetBusParent(orxHANDLE _hBus, orxHANDLE _hParentBus)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Delete(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetDuration(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetTime(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fTime)
orxDLLAPI void orxFASTCALL orxSoundSystem_EnableListener(orxU32 _u32ListenerIndex, orxBOOL _bEnable)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetVolume(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Pause(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_RemoveAllFilters(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_RemoveAllBusFilters(orxHANDLE _hBus)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_RemoveLastBusFilter(orxHANDLE _hBus)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetTime(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_IsListenerEnabled(orxU32 _u32ListenerIndex)
orxSOUNDSYSTEM_STREAM_TYPE
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_DeleteSample(orxSOUNDSYSTEM_SAMPLE *_pstSample)
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSoundSystem_LoadSample(const orxSTRING _zFilename)
orxDLLAPI orxHANDLE orxFASTCALL orxSoundSystem_CreateBus(orxSTRINGID _stBusID)
orxDLLAPI void orxFASTCALL orxSoundSystem_Exit()
orxDLLAPI orxBOOL orxFASTCALL orxSoundSystem_IsLooping(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSOUNDSYSTEM_SOUND *orxFASTCALL orxSoundSystem_CreateFromSample(orxHANDLE _hUserData, const orxSOUNDSYSTEM_SAMPLE *_pstSample)
orxDLLAPI orxFLOAT orxFASTCALL orxSoundSystem_GetPitch(const orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxU32 orxFASTCALL orxSoundSystem_GetListenerCount()
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_DeleteBus(orxHANDLE _hBus)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_RemoveLastFilter(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetVolume(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fVolume)
struct __orxSOUNDSYSTEM_SOUND_t orxSOUNDSYSTEM_SOUND
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetGlobalVolume(orxFLOAT _fGlobalVolume)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetSpatialization(orxSOUNDSYSTEM_SOUND *_pstSound, orxFLOAT _fMinDistance, orxFLOAT _fMaxDistance, orxFLOAT _fMinGain, orxFLOAT _fMaxGain, orxFLOAT _fRollOff)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetBus(orxSOUNDSYSTEM_SOUND *_pstSound, orxHANDLE _hBus)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Stop(orxSOUNDSYSTEM_SOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_GetSampleInfo(const orxSOUNDSYSTEM_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_Loop(orxSOUNDSYSTEM_SOUND *_pstSound, orxBOOL _bLoop)
orxDLLAPI orxSTATUS orxFASTCALL orxSoundSystem_SetListenerPosition(orxU32 _u32Index, const orxVECTOR *_pvPosition)
@ orxSOUNDSYSTEM_STATUS_PAUSE
@ orxSOUNDSYSTEM_STATUS_STOP
@ orxSOUNDSYSTEM_STATUS_PLAY
@ orxSOUNDSYSTEM_STATUS_NONE
@ orxSOUNDSYSTEM_STATUS_NUMBER
@ orxSOUND_FILTER_TYPE_BAND_PASS
@ orxSOUND_FILTER_TYPE_LOW_PASS
@ orxSOUND_FILTER_TYPE_NONE
@ orxSOUND_FILTER_TYPE_HIGH_SHELF
@ orxSOUND_FILTER_TYPE_HIGH_PASS
@ orxSOUND_FILTER_TYPE_BIQUAD
@ orxSOUND_FILTER_TYPE_CUSTOM
@ orxSOUND_FILTER_TYPE_PEAKING
@ orxSOUND_FILTER_TYPE_DELAY
@ orxSOUND_FILTER_TYPE_NUMBER
@ orxSOUND_FILTER_TYPE_LOW_SHELF
@ orxSOUND_FILTER_TYPE_NOTCH
@ orxSOUNDSYSTEM_STREAM_TYPE_NONE
@ orxSOUNDSYSTEM_STREAM_TYPE_NUMBER
@ orxSOUNDSYSTEM_STREAM_TYPE_TRIANGLE
@ orxSOUNDSYSTEM_STREAM_TYPE_EMPTY
@ orxSOUNDSYSTEM_STREAM_TYPE_WHITE
@ orxSOUNDSYSTEM_STREAM_TYPE_BROWNIAN
@ orxSOUNDSYSTEM_STREAM_TYPE_SQUARE
@ orxSOUNDSYSTEM_STREAM_TYPE_PINK
@ orxSOUNDSYSTEM_STREAM_TYPE_SINE
@ orxSOUNDSYSTEM_STREAM_TYPE_RESOURCE
@ orxSOUNDSYSTEM_STREAM_TYPE_SAWTOOTH
void * orxHANDLE
Definition orxType.h:166
orxSTATUS
Definition orxType.h:270
orxSOUND_FILTER_TYPE eType
orxSOUND_FILTER_FUNCTION pfnCallback

Generated for orx by doxygen 1.8.11