Neo
0.5.0
Developer Documentation
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
SoundContext.h
Go to the documentation of this file.
1
//========================================================================
2
// Copyright (c) 2003-2011 Anael Seghezzi <www.maratis3d.com>
3
//
4
// This software is provided 'as-is', without any express or implied
5
// warranty. In no event will the authors be held liable for any damages
6
// arising from the use of this software.
7
//
8
// Permission is granted to anyone to use this software for any purpose,
9
// including commercial applications, and to alter it and redistribute it
10
// freely, subject to the following restrictions:
11
//
12
// 1. The origin of this software must not be misrepresented; you must not
13
// claim that you wrote the original software. If you use this software
14
// in a product, an acknowledgment in the product documentation would
15
// be appreciated but is not required.
16
//
17
// 2. Altered source versions must be plainly marked as such, and must not
18
// be misrepresented as being the original software.
19
//
20
// 3. This notice may not be removed or altered from any source
21
// distribution.
22
//
23
//========================================================================
24
25
26
#ifndef __SOUND_CONTEXT_H
27
#define __SOUND_CONTEXT_H
28
29
namespace
Neo
30
{
31
32
enum
SOUND_FORMAT
33
{
34
SOUND_FORMAT_MONO8
= 0,
35
SOUND_FORMAT_MONO16
,
36
SOUND_FORMAT_STEREO8
,
37
SOUND_FORMAT_STEREO16
38
};
39
40
41
class
NEO_CORE_EXPORT
SoundContext
42
{
43
public
:
44
45
// destructor
46
virtual
~SoundContext
(
void
){}
47
48
// init context
49
virtual
void
initContext(
void
) = 0;
50
51
// buffer
52
virtual
void
createBuffer(
unsigned
int
* bufferId) = 0;
53
virtual
void
deleteBuffer(
unsigned
int
* bufferId) = 0;
54
virtual
void
sendBufferSound(
unsigned
int
bufferId,
Sound
* sound) = 0;
55
virtual
void
sendBufferData(
unsigned
int
bufferId,
SOUND_FORMAT
format,
void
* data,
unsigned
int
size,
unsigned
int
freq) = 0;
56
57
virtual
float
getBufferDuration(
unsigned
int
bufferId) = 0;
58
59
// source
60
virtual
void
createSource(
unsigned
int
* sourceId,
unsigned
int
bufferId) = 0;
61
virtual
void
deleteSource(
unsigned
int
* sourceId) = 0;
62
63
virtual
void
enableSourceLoop(
unsigned
int
sourceId) = 0;
64
virtual
void
disableSourceLoop(
unsigned
int
sourceId) = 0;
65
66
virtual
void
setSourceRelative(
unsigned
int
sourceId,
bool
relative) = 0;
67
68
virtual
void
setSourceBufferId(
unsigned
int
sourceId,
unsigned
int
bufferId) = 0;
69
virtual
void
setSourcePosition(
unsigned
int
sourceId,
const
Vector3
& position) = 0;
70
virtual
void
setSourceRadius(
unsigned
int
sourceId,
float
radius) = 0;
71
virtual
void
setSourcePitch(
unsigned
int
sourceId,
float
pitch) = 0;
72
virtual
void
setSourceGain(
unsigned
int
sourceId,
float
gain) = 0;
73
virtual
void
setSourceRolloff(
unsigned
int
sourceId,
float
rolloff) = 0;
74
virtual
void
setSourceOffset(
unsigned
int
sourceId,
float
offset) = 0;
75
76
virtual
float
getSourceOffset(
unsigned
int
sourceId) = 0;
77
78
virtual
void
playSource(
unsigned
int
sourceId) = 0;
79
virtual
void
pauseSource(
unsigned
int
sourceId) = 0;
80
virtual
void
stopSource(
unsigned
int
sourceId) = 0;
81
virtual
bool
isSourcePaused(
unsigned
int
sourceId) = 0;
82
virtual
bool
isSourcePlaying(
unsigned
int
sourceId) = 0;
83
virtual
float
getSourceTimePos(
unsigned
int
sourceId) = 0;
84
85
virtual
void
queueSourceBuffer(
unsigned
int
sourceId,
unsigned
int
* buffers,
unsigned
int
bufferSize) = 0;
86
virtual
void
unqueueSourceBuffer(
unsigned
int
sourceId,
unsigned
int
* buffers,
unsigned
int
bufferSize) = 0;
87
88
virtual
unsigned
int
getSourceBuffersQueued(
unsigned
int
sourceId) = 0;
89
virtual
unsigned
int
getSourceBuffersProcessed(
unsigned
int
sourceId) = 0;
90
91
// listener
92
virtual
void
updateListenerPosition(
const
Vector3
& position,
const
Vector3
& direction,
const
Vector3
& up) = 0;
93
};
94
}
95
#endif
Neo::Sound
Definition:
Sound.h:31
Neo::Vector3
Definition:
Vector3.h:31
Neo::SoundContext
Definition:
SoundContext.h:41
Neo::SoundContext::~SoundContext
virtual ~SoundContext(void)
Definition:
SoundContext.h:46
Neo::SOUND_FORMAT
SOUND_FORMAT
Definition:
SoundContext.h:32
Neo::SOUND_FORMAT_MONO16
Definition:
SoundContext.h:35
Neo::SOUND_FORMAT_STEREO8
Definition:
SoundContext.h:36
Neo::SOUND_FORMAT_MONO8
Definition:
SoundContext.h:34
Neo::SOUND_FORMAT_STEREO16
Definition:
SoundContext.h:37
Neo
Definition:
Color.h:29
neoengine
SDK
NeoCore
Includes
SoundContext.h
Generated on Thu Oct 22 2015 18:55:57 for Neo by
1.8.9.1