orx  stable
Portable Game Engine
orxSound.h
Go to the documentation of this file.
1 /* Orx - Portable Game Engine
2  *
3  * Copyright (c) 2008-2017 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 
43 #ifndef _orxSOUND_H_
44 #define _orxSOUND_H_
45 
46 
47 #include "orxInclude.h"
48 #include "sound/orxSoundSystem.h"
49 #include "math/orxVector.h"
50 
51 
54 #define orxSOUND_KZ_RESOURCE_GROUP "Sound"
55 
56 #define orxSOUND_KZ_MASTER_BUS "master"
57 
58 
61 typedef enum __orxSOUND_STATUS_t
62 {
66 
68 
69  orxSOUND_STATUS_NONE = orxENUM_NONE
70 
72 
73 
76 typedef struct __orxSOUND_t orxSOUND;
77 
78 
81 typedef enum __orxSOUND_EVENT_t
82 {
93 
94  orxSOUND_EVENT_NONE = orxENUM_NONE
95 
97 
100 typedef struct __orxSOUND_STREAM_INFO_t
101 {
102  orxU32 u32SampleRate;
106 
109 typedef struct __orxSOUND_STREAM_PACKET_t
110 {
112  orxS16 *as16SampleList;
113  orxBOOL bDiscard;
114  orxFLOAT fTimeStamp;
115  orxS32 s32ID;
118 
121 typedef struct __orxSOUND_EVENT_PAYLOAD_t
122 {
123  union
124  {
127  struct
128  {
129  const orxSTRING zSoundName;
132  } stStream;
133  };
136 
137 
140 extern orxDLLAPI void orxFASTCALL orxSound_Setup();
141 
145 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Init();
146 
149 extern orxDLLAPI void orxFASTCALL orxSound_Exit();
150 
151 
155 extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_Create();
156 
161 extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateFromConfig(const orxSTRING _zConfigID);
162 
169 extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateWithEmptyStream(orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zName);
170 
175 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Delete(orxSOUND *_pstSound);
176 
180 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_ClearCache();
181 
182 
190 extern orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSound_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate, const orxSTRING _zName);
191 
196 extern orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSound_GetSample(const orxSTRING _zName);
197 
202 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_DeleteSample(const orxSTRING _zName);
203 
209 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_LinkSample(orxSOUND *_pstSound, const orxSTRING _zSampleName);
210 
215 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_UnlinkSample(orxSOUND *_pstSound);
216 
217 
222 extern orxDLLAPI orxBOOL orxFASTCALL orxSound_IsStream(orxSOUND *_pstSound);
223 
224 
229 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Play(orxSOUND *_pstSound);
230 
235 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Pause(orxSOUND *_pstSound);
236 
241 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Stop(orxSOUND *_pstSound);
242 
243 
251 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber);
252 
256 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_StopRecording();
257 
261 extern orxDLLAPI orxBOOL orxFASTCALL orxSound_HasRecordingSupport();
262 
263 
269 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetVolume(orxSOUND *_pstSound, orxFLOAT _fVolume);
270 
276 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPitch(orxSOUND *_pstSound, orxFLOAT _fPitch);
277 
283 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPosition(orxSOUND *_pstSound, const orxVECTOR *_pvPosition);
284 
290 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetAttenuation(orxSOUND *_pstSound, orxFLOAT _fAttenuation);
291 
297 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetReferenceDistance(orxSOUND *_pstSound, orxFLOAT _fDistance);
298 
304 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_Loop(orxSOUND *_pstSound, orxBOOL _bLoop);
305 
306 
311 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetVolume(const orxSOUND *_pstSound);
312 
317 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetPitch(const orxSOUND *_pstSound);
318 
324 extern orxDLLAPI orxVECTOR *orxFASTCALL orxSound_GetPosition(const orxSOUND *_pstSound, orxVECTOR *_pvPosition);
325 
330 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetAttenuation(const orxSOUND *_pstSound);
331 
336 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetReferenceDistance(const orxSOUND *_pstSound);
337 
342 extern orxDLLAPI orxBOOL orxFASTCALL orxSound_IsLooping(const orxSOUND *_pstSound);
343 
344 
349 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetDuration(const orxSOUND *_pstSound);
350 
355 extern orxDLLAPI orxSOUND_STATUS orxFASTCALL orxSound_GetStatus(const orxSOUND *_pstSound);
356 
361 extern orxDLLAPI const orxSTRING orxFASTCALL orxSound_GetName(const orxSOUND *_pstSound);
362 
366 extern orxDLLAPI orxU32 orxFASTCALL orxSound_GetMasterBusID();
367 
372 extern orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusID(const orxSOUND *_pstSound);
373 
379 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusID(orxSOUND *_pstSound, orxU32 _u32BusID);
380 
386 extern orxDLLAPI orxSOUND *orxFASTCALL orxSound_GetNext(const orxSOUND *_pstSound, orxU32 _u32BusID);
387 
392 extern orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusParent(orxU32 _u32BusID);
393 
398 extern orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusChild(orxU32 _u32BusID);
399 
404 extern orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusSibling(orxU32 _u32BusID);
405 
411 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusParent(orxU32 _u32BusID, orxU32 _u32ParentBusID);
412 
417 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusVolume(orxU32 _u32BusID);
418 
423 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusPitch(orxU32 _u32BusID);
424 
430 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusVolume(orxU32 _u32BusID, orxFLOAT _fVolume);
431 
437 extern orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusPitch(orxU32 _u32BusID, orxFLOAT _fPitch);
438 
443 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalVolume(orxU32 _u32BusID);
444 
449 extern orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalPitch(orxU32 _u32BusID);
450 
451 #endif /*_orxSOUND_H_*/
452 
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetAttenuation(const orxSOUND *_pstSound)
orxDLLAPI void orxFASTCALL orxSound_Exit()
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusVolume(orxU32 _u32BusID, orxFLOAT _fVolume)
orxSOUND_STATUS
Definition: orxSound.h:61
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetReferenceDistance(orxSOUND *_pstSound, orxFLOAT _fDistance)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateFromConfig(const orxSTRING _zConfigID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Play(orxSOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetReferenceDistance(const orxSOUND *_pstSound)
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusParent(orxU32 _u32BusID)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_CreateWithEmptyStream(orxU32 _u32ChannelNumber, orxU32 _u32SampleRate, const orxSTRING _zName)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_GetNext(const orxSOUND *_pstSound, orxU32 _u32BusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetVolume(orxSOUND *_pstSound, orxFLOAT _fVolume)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_DeleteSample(const orxSTRING _zName)
const orxSTRING zSoundName
Definition: orxSound.h:129
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StartRecording(const orxCHAR *_zName, orxBOOL _bWriteToFile, orxU32 _u32SampleRate, orxU32 _u32ChannelNumber)
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSound_CreateSample(orxU32 _u32ChannelNumber, orxU32 _u32FrameNumber, orxU32 _u32SampleRate, const orxSTRING _zName)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Init()
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetDuration(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Delete(orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_LinkSample(orxSOUND *_pstSound, const orxSTRING _zSampleName)
orxSOUND * pstSound
Definition: orxSound.h:125
orxDLLAPI orxU32 orxFASTCALL orxSound_GetMasterBusID()
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPitch(orxSOUND *_pstSound, orxFLOAT _fPitch)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusVolume(orxU32 _u32BusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusPitch(orxU32 _u32BusID, orxFLOAT _fPitch)
orxDLLAPI orxSOUND_STATUS orxFASTCALL orxSound_GetStatus(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_ClearCache()
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsStream(orxSOUND *_pstSound)
orxSOUND_EVENT
Definition: orxSound.h:81
orxDLLAPI orxBOOL orxFASTCALL orxSound_IsLooping(const orxSOUND *_pstSound)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetPitch(const orxSOUND *_pstSound)
orxDLLAPI void orxFASTCALL orxSound_Setup()
orxSOUND_STREAM_INFO stInfo
Definition: orxSound.h:130
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetAttenuation(orxSOUND *_pstSound, orxFLOAT _fAttenuation)
orxU32 u32ChannelNumber
Definition: orxSound.h:103
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusID(const orxSOUND *_pstSound)
orxDLLAPI orxSOUNDSYSTEM_SAMPLE *orxFASTCALL orxSound_GetSample(const orxSTRING _zName)
orxSTATUS
Definition: orxType.h:243
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalVolume(orxU32 _u32BusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusParent(orxU32 _u32BusID, orxU32 _u32ParentBusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetPosition(orxSOUND *_pstSound, const orxVECTOR *_pvPosition)
#define orxDLLAPI
Definition: orxDecl.h:387
orxSOUND_STREAM_PACKET stPacket
Definition: orxSound.h:131
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Stop(orxSOUND *_pstSound)
orxS16 * as16SampleList
Definition: orxSound.h:112
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusGlobalPitch(orxU32 _u32BusID)
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetVolume(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Loop(orxSOUND *_pstSound, orxBOOL _bLoop)
orxDLLAPI orxBOOL orxFASTCALL orxSound_HasRecordingSupport()
orxDLLAPI orxVECTOR *orxFASTCALL orxSound_GetPosition(const orxSOUND *_pstSound, orxVECTOR *_pvPosition)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_Pause(orxSOUND *_pstSound)
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusSibling(orxU32 _u32BusID)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_UnlinkSample(orxSOUND *_pstSound)
orxDLLAPI const orxSTRING orxFASTCALL orxSound_GetName(const orxSOUND *_pstSound)
orxDLLAPI orxSTATUS orxFASTCALL orxSound_StopRecording()
orxDLLAPI orxSTATUS orxFASTCALL orxSound_SetBusID(orxSOUND *_pstSound, orxU32 _u32BusID)
orxDLLAPI orxSOUND *orxFASTCALL orxSound_Create()
orxDLLAPI orxU32 orxFASTCALL orxSound_GetBusChild(orxU32 _u32BusID)
struct __orxSOUNDSYSTEM_SAMPLE_t orxSOUNDSYSTEM_SAMPLE
orxDLLAPI orxFLOAT orxFASTCALL orxSound_GetBusPitch(orxU32 _u32BusID)
struct __orxSOUND_t orxSOUND
Definition: orxSound.h:76

Generated for orx by doxygen 1.5.6