Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wine-mirror
GitHub Repository: wine-mirror/wine
Path: blob/master/libs/faudio/include/FACT3D.h
4389 views
1
/* FAudio - XAudio Reimplementation for FNA
2
*
3
* Copyright (c) 2011-2024 Ethan Lee, Luigi Auriemma, and the MonoGame Team
4
*
5
* This software is provided 'as-is', without any express or implied warranty.
6
* In no event will the authors be held liable for any damages arising from
7
* 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 in a
15
* 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 distribution.
22
*
23
* Ethan "flibitijibibo" Lee <[email protected]>
24
*
25
*/
26
27
/* This file has no documentation since you are expected to already know how
28
* XACT works if you are still using these APIs!
29
*/
30
31
#ifndef FACT3D_H
32
#define FACT3D_H
33
34
#include "F3DAudio.h"
35
#include "FACT.h"
36
37
#ifdef __cplusplus
38
extern "C" {
39
#endif /* __cplusplus */
40
41
/* Constants */
42
43
#define LEFT_AZIMUTH (3.0f * F3DAUDIO_PI / 2.0f)
44
#define RIGHT_AZIMUTH (F3DAUDIO_PI / 2.0f)
45
#define FRONT_LEFT_AZIMUTH (7.0f * F3DAUDIO_PI / 4.0f)
46
#define FRONT_RIGHT_AZIMUTH (F3DAUDIO_PI / 4.0f)
47
#define FRONT_CENTER_AZIMUTH 0.0f
48
#define LOW_FREQUENCY_AZIMUTH F3DAUDIO_2PI
49
#define BACK_LEFT_AZIMUTH (5.0f * F3DAUDIO_PI / 4.0f)
50
#define BACK_RIGHT_AZIMUTH (3.0f * F3DAUDIO_PI / 4.0f)
51
#define BACK_CENTER_AZIMUTH F3DAUDIO_PI
52
#define FRONT_LEFT_OF_CENTER_AZIMUTH (15.0f * F3DAUDIO_PI / 8.0f)
53
#define FRONT_RIGHT_OF_CENTER_AZIMUTH (F3DAUDIO_PI / 8.0f)
54
55
static const float aStereoLayout[] =
56
{
57
LEFT_AZIMUTH,
58
RIGHT_AZIMUTH
59
};
60
static const float a2Point1Layout[] =
61
{
62
LEFT_AZIMUTH,
63
RIGHT_AZIMUTH,
64
LOW_FREQUENCY_AZIMUTH
65
};
66
static const float aQuadLayout[] =
67
{
68
FRONT_LEFT_AZIMUTH,
69
FRONT_RIGHT_AZIMUTH,
70
BACK_LEFT_AZIMUTH,
71
BACK_RIGHT_AZIMUTH
72
};
73
static const float a4Point1Layout[] =
74
{
75
FRONT_LEFT_AZIMUTH,
76
FRONT_RIGHT_AZIMUTH,
77
LOW_FREQUENCY_AZIMUTH,
78
BACK_LEFT_AZIMUTH,
79
BACK_RIGHT_AZIMUTH
80
};
81
static const float a5Point1Layout[] =
82
{
83
FRONT_LEFT_AZIMUTH,
84
FRONT_RIGHT_AZIMUTH,
85
FRONT_CENTER_AZIMUTH,
86
LOW_FREQUENCY_AZIMUTH,
87
BACK_LEFT_AZIMUTH,
88
BACK_RIGHT_AZIMUTH
89
};
90
static const float a7Point1Layout[] =
91
{
92
FRONT_LEFT_AZIMUTH,
93
FRONT_RIGHT_AZIMUTH,
94
FRONT_CENTER_AZIMUTH,
95
LOW_FREQUENCY_AZIMUTH,
96
BACK_LEFT_AZIMUTH,
97
BACK_RIGHT_AZIMUTH,
98
LEFT_AZIMUTH,
99
RIGHT_AZIMUTH
100
};
101
102
/* Functions */
103
104
FACTAPI uint32_t FACT3DInitialize(
105
FACTAudioEngine *pEngine,
106
F3DAUDIO_HANDLE F3DInstance
107
);
108
109
FACTAPI uint32_t FACT3DCalculate(
110
F3DAUDIO_HANDLE F3DInstance,
111
const F3DAUDIO_LISTENER *pListener,
112
F3DAUDIO_EMITTER *pEmitter,
113
F3DAUDIO_DSP_SETTINGS *pDSPSettings
114
);
115
116
FACTAPI uint32_t FACT3DApply(
117
F3DAUDIO_DSP_SETTINGS *pDSPSettings,
118
FACTCue *pCue
119
);
120
121
#ifdef __cplusplus
122
}
123
#endif /* __cplusplus */
124
125
#endif /* FACT3D_H */
126
127
/* vim: set noexpandtab shiftwidth=8 tabstop=8: */
128
129