-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenal-context.ads
189 lines (139 loc) · 4.77 KB
/
openal-context.ads
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
with OpenAL.ALC_Thin;
with OpenAL.List;
with OpenAL.Types;
package OpenAL.Context is
--
-- Types
--
type Device_t is private;
type Context_t is private;
type Context_Attributes_t is private;
Invalid_Device : constant Device_t;
Invalid_Context : constant Context_t;
Null_Context : constant Context_t;
type Format_t is (Mono_8, Stereo_8, Mono_16, Stereo_16, Unknown);
subtype Request_Format_t is Format_t range Mono_8 .. Stereo_16;
--
-- API
--
-- proc_map : alcOpenDevice
function Open_Device
(Specifier : in String) return Device_t;
-- proc_map : alcOpenDevice
function Open_Default_Device return Device_t;
procedure Set_Frequency
(Attributes : in out Context_Attributes_t;
Frequency : in Types.Frequency_t);
procedure Set_Refresh
(Attributes : in out Context_Attributes_t;
Refresh : in Positive);
procedure Set_Synchronous
(Attributes : in out Context_Attributes_t;
Synchronous : in Boolean);
procedure Set_Mono_Sources
(Attributes : in out Context_Attributes_t;
Sources : in Natural);
procedure Set_Stereo_Sources
(Attributes : in out Context_Attributes_t;
Sources : in Natural);
-- proc_map : alcCloseDevice
procedure Close_Device
(Device : in out Device_t);
-- proc_map : alcCreateContext
function Create_Context
(Device : in Device_t) return Context_t;
-- proc_map : alcCreateContext
function Create_Context_With_Attributes
(Device : in Device_t;
Attributes : in Context_Attributes_t) return Context_t;
-- proc_map : alcMakeContextCurrent
function Make_Context_Current
(Context : in Context_t) return Boolean;
-- proc_map : alcProcessContext
procedure Process_Context
(Context : in Context_t);
-- proc_map : alcSuspendContext
procedure Suspend_Context
(Context : in Context_t);
-- proc_map : alcDestroyContext
procedure Destroy_Context
(Context : in Context_t);
-- proc_map : alcGetCurrentContext
function Get_Current_Context return Context_t;
-- proc_map : alcGetContextsDevice
function Get_Context_Device (Context : in Context_t) return Device_t;
-- proc_map : alcIsExtensionPresent
function Is_Extension_Present
(Device : in Device_t;
Name : in String) return Boolean;
--
-- String queries
--
-- proc_map : alcGetString
function Get_Default_Device_Specifier return String;
-- proc_map : alcGetString
function Get_Device_Specifier
(Device : in Device_t) return String;
-- proc_map : alcGetString
function Get_Extensions
(Device : in Device_t) return String;
-- proc_map : alcGetString
function Get_Default_Capture_Device_Specifier return String;
-- proc_map : alcGetString
function Get_Available_Capture_Devices return OpenAL.List.String_Vector_t;
-- proc_map : alcGetString
function Get_Available_Playback_Devices return OpenAL.List.String_Vector_t;
--
-- Integer queries
--
-- proc_map : alcGetIntegerv
function Get_Major_Version
(Device : in Device_t) return Natural;
-- proc_map : alcGetIntegerv
function Get_Minor_Version
(Device : in Device_t) return Natural;
-- proc_map : alcGetIntegerv
function Get_Capture_Samples
(Device : in Device_t) return Natural;
-- proc_map : alcGetIntegerv
function Get_Frequency
(Device : in Device_t) return Types.Frequency_t;
-- proc_map : alcGetIntegerv
function Get_Refresh
(Device : in Device_t) return Natural;
-- proc_map : alcGetIntegerv
function Get_Synchronous
(Device : in Device_t) return Boolean;
-- proc_map : alcGetIntegerv
function Get_Mono_Sources
(Device : in Device_t) return Natural;
-- proc_map : alcGetIntegerv
function Get_Stereo_Sources
(Device : in Device_t) return Natural;
--
-- Private conveniences.
--
function Device_Data (Device : in Device_t) return ALC_Thin.Device_t;
private
type Device_t is record
Device_Data : ALC_Thin.Device_t := ALC_Thin.Invalid_Device;
Capture_Format : Format_t := Unknown;
Capture : Boolean := False;
end record;
type Context_t is new ALC_Thin.Context_t;
Invalid_Device : constant Device_t := (others => <>);
Invalid_Context : constant Context_t := Context_t (ALC_Thin.Invalid_Context);
Null_Context : constant Context_t := Invalid_Context;
type Attribute_t is
(Attribute_Frequency,
Attribute_Refresh,
Attribute_Synchronous,
Attribute_Mono_Sources,
Attribute_Stereo_Sources);
type Attribute_Array_t is array (Attribute_t) of Types.Integer_t;
type Attribute_Specified_t is array (Attribute_t) of Boolean;
type Context_Attributes_t is record
Values : Attribute_Array_t := (others => 0);
Specified : Attribute_Specified_t := (others => False);
end record;
end OpenAL.Context;