orx 1.16
Portable Game Engine
Loading...
Searching...
No Matches
orxSound.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 _orxSOUND_H_
44#define _orxSOUND_H_
45
46
47#include "orxInclude.h"
48#include "math/orxVector.h"
50
51
54#define orxSOUND_KZ_RESOURCE_GROUP "Sound"
55#define orxSOUND_KZ_LOCALE_GROUP "Sound"
56
57#define orxSOUND_KZ_MASTER_BUS "master"
58
59
73
74
77typedef struct __orxSOUND_t orxSOUND;
78typedef struct __orxSOUND_SAMPLE_t orxSOUND_SAMPLE;
79
80
100
103typedef struct __orxSOUND_STREAM_INFO_t
104{
105 const orxSTRING zName;
108
110
113typedef struct __orxSOUND_STREAM_PACKET_t
114{
115 orxFLOAT *afSampleList;
117 orxFLOAT fTimeStamp;
118 orxFLOAT fTime;
119 orxS32 s32ID;
120 orxBOOL bDiscard;
121 orxBOOL bLast;
122
124
127typedef struct __orxSOUND_EVENT_PAYLOAD_t
128{
130
131 struct
132 {
135
136 } stStream;
137
138 struct
139 {
141 orxSTRINGID stBusID;
142
143 } stFilter;
144
146
147
150extern orxDLLAPI void orxFASTCALL orxSound_Setup();
151
155extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Init();
156
159extern orxDLLAPI void orxFASTCALL orxSound_Exit();
160
161
165extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_Create();
166
171extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateFromConfig(const orxSTRING _zConfigID);
172
179extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateWithEmptyStream(orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zName);
180
185extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Delete(orxSOUND *_pstSound);
186
191
192
200extern orxDLLAPI orxSOUND_SAMPLE *orxFASTCALL orxSound_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate, const orxSTRING _zName);
201
207
215extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetSampleInfo(const orxSOUND_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate);
216
223extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetSampleData(orxSOUND_SAMPLE *_pstSample, const orxFLOAT *_afData, orxU32 _u32SampleNumber);
224
230extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_LinkSample(orxSOUND *_pstSound, const orxSTRING _zSampleName);
231
236extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_UnlinkSample(orxSOUND *_pstSound);
237
238
243extern orxDLLAPI orxBOOL orxFASTCALL orxSound_IsStream(orxSOUND *_pstSound);
244
245
250extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Play(orxSOUND *_pstSound);
251
256extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Pause(orxSOUND *_pstSound);
257
262extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Stop(orxSOUND *_pstSound);
263
270extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddFilter(orxSOUND *_pstSound, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam);
271
277
283
289extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddFilterFromConfig(orxSOUND *_pstSound, const orxSTRING _zFilterConfigID);
290
291
299extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber);
300
305
309extern orxDLLAPI orxBOOL orxFASTCALL orxSound_HasRecordingSupport();
310
311
317extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetVolume(orxSOUND *_pstSound, orxFLOAT _fVolume);
318
324extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPitch(orxSOUND *_pstSound, orxFLOAT _fPitch);
325
331extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetTime(orxSOUND *_pstSound, orxFLOAT _fTime);
332
338extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPosition(orxSOUND *_pstSound, const orxVECTOR *_pvPosition);
339
349extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetSpatialization(orxSOUND *_pstSound, orxFLOAT _fMinDistance, orxFLOAT _fMaxDistance, orxFLOAT _fMinGain, orxFLOAT _fMaxGain, orxFLOAT _fRollOff);
350
357extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPanning(orxSOUND *_pstSound, orxFLOAT _fPanning, orxBOOL _bMix);
358
364extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Loop(orxSOUND *_pstSound, orxBOOL _bLoop);
365
366
371extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetVolume(const orxSOUND *_pstSound);
372
377extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetPitch(const orxSOUND *_pstSound);
378
383extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetTime(const orxSOUND *_pstSound);
384
390extern orxDLLAPI orxVECTOR *orxFASTCALL orxSound_GetPosition(const orxSOUND *_pstSound, orxVECTOR *_pvPosition);
391
401extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetSpatialization(const orxSOUND *_pstSound, orxFLOAT *_pfMinDistance, orxFLOAT *_pfMaxDistance, orxFLOAT *_pfMinGain, orxFLOAT *_pfMaxGain, orxFLOAT *_pfRollOff);
402
409extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetPanning(const orxSOUND *_pstSound, orxFLOAT *_pfPanning, orxBOOL *_pbMix);
410
415extern orxDLLAPI orxBOOL orxFASTCALL orxSound_IsLooping(const orxSOUND *_pstSound);
416
417
422extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetDuration(const orxSOUND *_pstSound);
423
428extern orxDLLAPI orxSOUND_STATUS orxFASTCALL orxSound_GetStatus(const orxSOUND *_pstSound);
429
434extern orxDLLAPI const orxSTRING orxFASTCALL orxSound_GetName(const orxSOUND *_pstSound);
435
439extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetMasterBusID();
440
445extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusID(const orxSOUND *_pstSound);
446
452extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusID(orxSOUND *_pstSound, orxSTRINGID _stBusID);
453
459extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_GetNext(const orxSOUND *_pstSound, orxSTRINGID _stBusID);
460
465extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusParent(orxSTRINGID _stBusID);
466
471extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusChild(orxSTRINGID _stBusID);
472
477extern orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusSibling(orxSTRINGID _stBusID);
478
484extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusParent(orxSTRINGID _stBusID, orxSTRINGID _stParentBusID);
485
490extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusVolume(orxSTRINGID _stBusID);
491
496extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusPitch(orxSTRINGID _stBusID);
497
503extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusVolume(orxSTRINGID _stBusID, orxFLOAT _fVolume);
504
510extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusPitch(orxSTRINGID _stBusID, orxFLOAT _fPitch);
511
516extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalVolume(orxSTRINGID _stBusID);
517
522extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalPitch(orxSTRINGID _stBusID);
523
530extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddBusFilter(orxSTRINGID _stBusID, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam);
531
536extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveLastBusFilter(orxSTRINGID _stBusID);
537
542extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveAllBusFilters(orxSTRINGID _stBusID);
543
549extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddBusFilterFromConfig(orxSTRINGID _stBusID, const orxSTRING _zFilterConfigID);
550
551#endif /*_orxSOUND_H_*/
552
#define orxDLLAPI
Definition orxDecl.h:381
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Stop(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Loop(orxSOUND *_pstSound, orxBOOL _bLoop)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveLastFilter(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusParent(orxSTRINGID _stBusID, orxSTRINGID _stParentBusID)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetTime(const orxSOUND *_pstSound)
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsStream(orxSOUND *_pstSound)
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetMasterBusID()
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetSpatialization(orxSOUND *_pstSound, orxFLOAT _fMinDistance, orxFLOAT _fMaxDistance, orxFLOAT _fMinGain, orxFLOAT _fMaxGain, orxFLOAT _fRollOff)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddBusFilterFromConfig(orxSTRINGID _stBusID, const orxSTRING _zFilterConfigID)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetDuration(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveAllFilters(orxSOUND *_pstSound)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateWithEmptyStream(orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zName)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusPitch(orxSTRINGID _stBusID, orxFLOAT _fPitch)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalPitch(orxSTRINGID _stBusID)
orxDLLAPI orxSOUND_SAMPLE *orxFASTCALL orxSound_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate, const orxSTRING _zName)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusVolume(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Pause(orxSOUND *_pstSound)
struct __orxSOUND_t orxSOUND
Definition orxSound.h:77
orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveAllBusFilters(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddFilterFromConfig(orxSOUND *_pstSound, const orxSTRING _zFilterConfigID)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_Create()
orxDLLAPI void orxFASTCALL orxSound_Exit()
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusParent(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPanning(orxSOUND *_pstSound, orxFLOAT _fPanning, orxBOOL _bMix)
orxDLLAPI orxBOOL orxFASTCALL orxSound_HasRecordingSupport()
orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetPanning(const orxSOUND *_pstSound, orxFLOAT *_pfPanning, orxBOOL *_pbMix)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Play(orxSOUND *_pstSound)
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusSibling(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetSpatialization(const orxSOUND *_pstSound, orxFLOAT *_pfMinDistance, orxFLOAT *_pfMaxDistance, orxFLOAT *_pfMinGain, orxFLOAT *_pfMaxGain, orxFLOAT *_pfRollOff)
orxDLLAPI orxSOUND_STATUS orxFASTCALL orxSound_GetStatus(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusVolume(orxSTRINGID _stBusID, orxFLOAT _fVolume)
orxSOUND_STATUS
Definition orxSound.h:63
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetVolume(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetTime(orxSOUND *_pstSound, orxFLOAT _fTime)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Delete(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_GetSampleInfo(const orxSOUND_SAMPLE *_pstSample, orxU32 *_pu32ChannelNumber, orxU32 *_pu32FrameNumber, orxU32 *_pu32SampleRate)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_GetNext(const orxSOUND *_pstSound, orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_UnlinkSample(orxSOUND *_pstSound)
orxDLLAPI orxVECTOR *orxFASTCALL orxSound_GetPosition(const orxSOUND *_pstSound, orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_DeleteSample(orxSOUND_SAMPLE *_pstSample)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_LinkSample(orxSOUND *_pstSound, const orxSTRING _zSampleName)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber)
struct __orxSOUND_SAMPLE_t orxSOUND_SAMPLE
Definition orxSound.h:78
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusChild(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetVolume(orxSOUND *_pstSound, orxFLOAT _fVolume)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateFromConfig(const orxSTRING _zConfigID)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalVolume(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddBusFilter(orxSTRINGID _stBusID, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_RemoveLastBusFilter(orxSTRINGID _stBusID)
orxDLLAPI void orxFASTCALL orxSound_Setup()
orxDLLAPI orxSTRINGID orxFASTCALL orxSound_GetBusID(const orxSOUND *_pstSound)
orxDLLAPI const orxSTRING orxFASTCALL orxSound_GetName(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusID(orxSOUND *_pstSound, orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetSampleData(orxSOUND_SAMPLE *_pstSample, const orxFLOAT *_afData, orxU32 _u32SampleNumber)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_ClearCache()
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsLooping(const orxSOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetPitch(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPosition(orxSOUND *_pstSound, const orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StopRecording()
orxSOUND_EVENT
Definition orxSound.h:84
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Init()
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusPitch(orxSTRINGID _stBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPitch(orxSOUND *_pstSound, orxFLOAT _fPitch)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_AddFilter(orxSOUND *_pstSound, const orxSOUND_FILTER_DATA *_pstFilterData, orxBOOL _bUseCustomParam)
@ orxSOUND_STATUS_PAUSE
Definition orxSound.h:65
@ orxSOUND_STATUS_NUMBER
Definition orxSound.h:68
@ orxSOUND_STATUS_STOP
Definition orxSound.h:66
@ orxSOUND_STATUS_PLAY
Definition orxSound.h:64
@ orxSOUND_STATUS_NONE
Definition orxSound.h:70
@ orxSOUND_EVENT_REMOVE
Definition orxSound.h:88
@ orxSOUND_EVENT_SET_FILTER_PARAM
Definition orxSound.h:93
@ orxSOUND_EVENT_RECORDING_PACKET
Definition orxSound.h:92
@ orxSOUND_EVENT_STOP
Definition orxSound.h:86
@ orxSOUND_EVENT_RECORDING_START
Definition orxSound.h:90
@ orxSOUND_EVENT_START
Definition orxSound.h:85
@ orxSOUND_EVENT_RECORDING_STOP
Definition orxSound.h:91
@ orxSOUND_EVENT_NUMBER
Definition orxSound.h:95
@ orxSOUND_EVENT_PACKET
Definition orxSound.h:89
@ orxSOUND_EVENT_NONE
Definition orxSound.h:97
@ orxSOUND_EVENT_ADD
Definition orxSound.h:87
#define orxSOUND(STRUCTURE)
orxSTATUS
Definition orxType.h:270
orxSOUND_STREAM_PACKET stPacket
Definition orxSound.h:134
orxSTRINGID stBusID
Definition orxSound.h:141
orxSOUND_STREAM_INFO stInfo
Definition orxSound.h:133
orxSOUND_FILTER_DATA stData
Definition orxSound.h:140
const orxSTRING zName
Definition orxSound.h:105
orxFLOAT * afSampleList
Definition orxSound.h:115

Generated for orx by doxygen 1.8.11