rlm@0
|
1 <?xml version="1.0" encoding="utf-8"?>
|
rlm@0
|
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
rlm@0
|
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
rlm@0
|
4 <html xmlns="http://www.w3.org/1999/xhtml"
|
rlm@0
|
5 lang="en" xml:lang="en">
|
rlm@0
|
6 <head>
|
rlm@0
|
7 <title>all the steps to add a device to open-al</title>
|
rlm@0
|
8 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
rlm@0
|
9 <meta name="generator" content="Org-mode"/>
|
rlm@0
|
10 <meta name="generated" content="2011-10-20 15:48:47 MST"/>
|
rlm@0
|
11 <meta name="author" content="Robert McIntyre"/>
|
rlm@0
|
12 <meta name="description" content="how to add a new device to open-al"/>
|
rlm@0
|
13 <meta name="keywords" content=""/>
|
rlm@0
|
14 <style type="text/css">
|
rlm@0
|
15 <!--/*--><![CDATA[/*><!--*/
|
rlm@0
|
16 html { font-family: Times, serif; font-size: 12pt; }
|
rlm@0
|
17 .title { text-align: center; }
|
rlm@0
|
18 .todo { color: red; }
|
rlm@0
|
19 .done { color: green; }
|
rlm@0
|
20 .tag { background-color: #add8e6; font-weight:normal }
|
rlm@0
|
21 .target { }
|
rlm@0
|
22 .timestamp { color: #bebebe; }
|
rlm@0
|
23 .timestamp-kwd { color: #5f9ea0; }
|
rlm@0
|
24 .right {margin-left:auto; margin-right:0px; text-align:right;}
|
rlm@0
|
25 .left {margin-left:0px; margin-right:auto; text-align:left;}
|
rlm@0
|
26 .center {margin-left:auto; margin-right:auto; text-align:center;}
|
rlm@0
|
27 p.verse { margin-left: 3% }
|
rlm@0
|
28 pre {
|
rlm@0
|
29 border: 1pt solid #AEBDCC;
|
rlm@0
|
30 background-color: #F3F5F7;
|
rlm@0
|
31 padding: 5pt;
|
rlm@0
|
32 font-family: courier, monospace;
|
rlm@0
|
33 font-size: 90%;
|
rlm@0
|
34 overflow:auto;
|
rlm@0
|
35 }
|
rlm@0
|
36 table { border-collapse: collapse; }
|
rlm@0
|
37 td, th { vertical-align: top; }
|
rlm@0
|
38 th.right { text-align:center; }
|
rlm@0
|
39 th.left { text-align:center; }
|
rlm@0
|
40 th.center { text-align:center; }
|
rlm@0
|
41 td.right { text-align:right; }
|
rlm@0
|
42 td.left { text-align:left; }
|
rlm@0
|
43 td.center { text-align:center; }
|
rlm@0
|
44 dt { font-weight: bold; }
|
rlm@0
|
45 div.figure { padding: 0.5em; }
|
rlm@0
|
46 div.figure p { text-align: center; }
|
rlm@0
|
47 textarea { overflow-x: auto; }
|
rlm@0
|
48 .linenr { font-size:smaller }
|
rlm@0
|
49 .code-highlighted {background-color:#ffff00;}
|
rlm@0
|
50 .org-info-js_info-navigation { border-style:none; }
|
rlm@0
|
51 #org-info-js_console-label { font-size:10px; font-weight:bold;
|
rlm@0
|
52 white-space:nowrap; }
|
rlm@0
|
53 .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
|
rlm@0
|
54 font-weight:bold; }
|
rlm@0
|
55 /*]]>*/-->
|
rlm@0
|
56 </style>
|
rlm@0
|
57 <link rel="stylesheet" type="text/css" href="/aurellem/css/aurellem.css" />
|
rlm@0
|
58 <script type="text/javascript">
|
rlm@0
|
59 <!--/*--><![CDATA[/*><!--*/
|
rlm@0
|
60 function CodeHighlightOn(elem, id)
|
rlm@0
|
61 {
|
rlm@0
|
62 var target = document.getElementById(id);
|
rlm@0
|
63 if(null != target) {
|
rlm@0
|
64 elem.cacheClassElem = elem.className;
|
rlm@0
|
65 elem.cacheClassTarget = target.className;
|
rlm@0
|
66 target.className = "code-highlighted";
|
rlm@0
|
67 elem.className = "code-highlighted";
|
rlm@0
|
68 }
|
rlm@0
|
69 }
|
rlm@0
|
70 function CodeHighlightOff(elem, id)
|
rlm@0
|
71 {
|
rlm@0
|
72 var target = document.getElementById(id);
|
rlm@0
|
73 if(elem.cacheClassElem)
|
rlm@0
|
74 elem.className = elem.cacheClassElem;
|
rlm@0
|
75 if(elem.cacheClassTarget)
|
rlm@0
|
76 target.className = elem.cacheClassTarget;
|
rlm@0
|
77 }
|
rlm@0
|
78 /*]]>*///-->
|
rlm@0
|
79 </script>
|
rlm@0
|
80
|
rlm@0
|
81 </head>
|
rlm@0
|
82 <body>
|
rlm@0
|
83
|
rlm@0
|
84 <div id="content">
|
rlm@0
|
85
|
rlm@0
|
86
|
rlm@0
|
87
|
rlm@0
|
88 <div class="header">
|
rlm@0
|
89 <div class="float-right">
|
rlm@0
|
90 <!--
|
rlm@0
|
91 <form>
|
rlm@0
|
92 <input type="text"/><input type="submit" value="search the blog »"/>
|
rlm@0
|
93 </form>
|
rlm@0
|
94 -->
|
rlm@0
|
95 </div>
|
rlm@0
|
96
|
rlm@0
|
97 <h1>aurellem <em>☉</em></h1>
|
rlm@0
|
98 <ul class="nav">
|
rlm@0
|
99 <li><a href="/">read the blog »</a></li>
|
rlm@0
|
100 <!-- li><a href="#">learn about us »</a></li-->
|
rlm@0
|
101 </ul>
|
rlm@0
|
102 </div>
|
rlm@0
|
103
|
rlm@0
|
104 <h1 class="title">all the steps to add a device to open-al</h1>
|
rlm@0
|
105 <div class="author">Written by <author>Robert McIntyre</author></div>
|
rlm@0
|
106
|
rlm@0
|
107
|
rlm@0
|
108
|
rlm@0
|
109
|
rlm@0
|
110
|
rlm@0
|
111
|
rlm@0
|
112
|
rlm@0
|
113 <div id="table-of-contents">
|
rlm@0
|
114 <h2>Table of Contents</h2>
|
rlm@0
|
115 <div id="text-table-of-contents">
|
rlm@0
|
116 <ul>
|
rlm@0
|
117 <li><a href="#sec-1">1 How to add a new backend device </a></li>
|
rlm@0
|
118 <li><a href="#sec-2">2 In Alc/backends/<your-device>.c </a></li>
|
rlm@0
|
119 <li><a href="#sec-3">3 In OpenAL32/Include/alMain.h : </a></li>
|
rlm@0
|
120 <li><a href="#sec-4">4 In Alc/ALc.c : </a></li>
|
rlm@0
|
121 <li><a href="#sec-5">5 In CMakeLists.txt </a></li>
|
rlm@0
|
122 <li><a href="#sec-6">6 In ~/.alsoftrc </a></li>
|
rlm@0
|
123 </ul>
|
rlm@0
|
124 </div>
|
rlm@0
|
125 </div>
|
rlm@0
|
126
|
rlm@0
|
127 <div id="outline-container-1" class="outline-2">
|
rlm@0
|
128 <h2 id="sec-1"><span class="section-number-2">1</span> How to add a new backend device </h2>
|
rlm@0
|
129 <div class="outline-text-2" id="text-1">
|
rlm@0
|
130
|
rlm@0
|
131
|
rlm@0
|
132 </div>
|
rlm@0
|
133
|
rlm@0
|
134 </div>
|
rlm@0
|
135
|
rlm@0
|
136 <div id="outline-container-2" class="outline-2">
|
rlm@0
|
137 <h2 id="sec-2"><span class="section-number-2">2</span> In Alc/backends/<your-device>.c </h2>
|
rlm@0
|
138 <div class="outline-text-2" id="text-2">
|
rlm@0
|
139
|
rlm@0
|
140
|
rlm@0
|
141
|
rlm@0
|
142
|
rlm@0
|
143
|
rlm@0
|
144 <pre class="src src-C"><span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #f0dfaf; font-weight: bold;">const</span> <span style="color: #dfdfbf; font-weight: bold;">ALCchar</span> <your-device>_device[] = <your-device-name>;
|
rlm@0
|
145
|
rlm@0
|
146 <span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> <span style="color: #f0dfaf;">alc_</span><your-device>_init(BackendFuncs *func_list)
|
rlm@0
|
147 <span style="color: #dfdfbf; font-weight: bold;">void</span> <span style="color: #f0dfaf;">alc_</span><your-device>_deinit(<span style="color: #dfdfbf; font-weight: bold;">void</span>)
|
rlm@0
|
148
|
rlm@0
|
149 <span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> <your-device>_open_playback(ALCdevice *device, <span style="color: #f0dfaf; font-weight: bold;">const</span> <span style="color: #dfdfbf; font-weight: bold;">ALCchar</span> *<span style="color: #f0dfaf;">deviceName</span>)
|
rlm@0
|
150 <span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">void</span> <your-device>_close_playback(ALCdevice *device)
|
rlm@0
|
151 <span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> <your-device>_reset_playback(ALCdevice *device)
|
rlm@0
|
152 <span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">void</span> <your-device>_stop_playback(ALCdevice *device)
|
rlm@0
|
153 </pre>
|
rlm@0
|
154
|
rlm@0
|
155
|
rlm@0
|
156
|
rlm@0
|
157
|
rlm@0
|
158
|
rlm@0
|
159 <pre class="src src-C"><span style="color: #dfdfbf; font-weight: bold;">void</span> <span style="color: #f0dfaf;">alc_</span><your-device>_probe(<span style="color: #f0dfaf; font-weight: bold;">enum</span> <span style="color: #dfdfbf; font-weight: bold;">DevProbe</span> <span style="color: #f0dfaf;">type</span>)
|
rlm@0
|
160 {
|
rlm@0
|
161 <span style="color: #f0dfaf; font-weight: bold;">switch</span>(type)
|
rlm@0
|
162 {
|
rlm@0
|
163 <span style="color: #f0dfaf; font-weight: bold;">case</span> DEVICE_PROBE:
|
rlm@0
|
164 AppendDeviceList(<your-device>Device);
|
rlm@0
|
165 <span style="color: #f0dfaf; font-weight: bold;">break</span>;
|
rlm@0
|
166 <span style="color: #f0dfaf; font-weight: bold;">case</span> ALL_DEVICE_PROBE:
|
rlm@0
|
167 AppendAllDeviceList(<your-device>Device);
|
rlm@0
|
168 <span style="color: #f0dfaf; font-weight: bold;">break</span>;
|
rlm@0
|
169 <span style="color: #f0dfaf; font-weight: bold;">case</span> CAPTURE_DEVICE_PROBE:
|
rlm@0
|
170 <span style="color: #f0dfaf; font-weight: bold;">break</span>;
|
rlm@0
|
171 }
|
rlm@0
|
172 }
|
rlm@0
|
173 </pre>
|
rlm@0
|
174
|
rlm@0
|
175
|
rlm@0
|
176
|
rlm@0
|
177
|
rlm@0
|
178
|
rlm@0
|
179 <pre class="src src-C"><span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #f0dfaf; font-weight: bold;">const</span> <span style="color: #dfdfbf; font-weight: bold;">BackendFuncs</span> <your-device>_funcs = {
|
rlm@0
|
180 <your-device>_open_playback,
|
rlm@0
|
181 <your-device>_close_playback,
|
rlm@0
|
182 <your-device>_reset_playback,
|
rlm@0
|
183 <your-device>_stop_playback,
|
rlm@0
|
184 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
|
rlm@0
|
185 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
|
rlm@0
|
186 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
|
rlm@0
|
187 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
|
rlm@0
|
188 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
|
rlm@0
|
189 <span style="color: #dca3a3; font-weight: bold;">NULL</span>
|
rlm@0
|
190 };
|
rlm@0
|
191 </pre>
|
rlm@0
|
192
|
rlm@0
|
193
|
rlm@0
|
194
|
rlm@0
|
195
|
rlm@0
|
196
|
rlm@0
|
197 </div>
|
rlm@0
|
198
|
rlm@0
|
199 </div>
|
rlm@0
|
200
|
rlm@0
|
201 <div id="outline-container-3" class="outline-2">
|
rlm@0
|
202 <h2 id="sec-3"><span class="section-number-2">3</span> In OpenAL32/Include/alMain.h : </h2>
|
rlm@0
|
203 <div class="outline-text-2" id="text-3">
|
rlm@0
|
204
|
rlm@0
|
205
|
rlm@0
|
206
|
rlm@0
|
207
|
rlm@0
|
208
|
rlm@0
|
209 <pre class="src src-C"><span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> <span style="color: #f0dfaf;">alc_</span><your-device>_init(BackendFuncs *func_list);
|
rlm@0
|
210 <span style="color: #dfdfbf; font-weight: bold;">void</span> <span style="color: #f0dfaf;">alc_</span><your-device>_deinit(<span style="color: #dfdfbf; font-weight: bold;">void</span>);
|
rlm@0
|
211 <span style="color: #dfdfbf; font-weight: bold;">void</span> <span style="color: #f0dfaf;">alc_</span><your-device>_probe(<span style="color: #f0dfaf; font-weight: bold;">enum</span> <span style="color: #dfdfbf; font-weight: bold;">DevProbe</span> <span style="color: #f0dfaf;">type</span>);
|
rlm@0
|
212
|
rlm@0
|
213 </pre>
|
rlm@0
|
214
|
rlm@0
|
215
|
rlm@0
|
216
|
rlm@0
|
217
|
rlm@0
|
218 </div>
|
rlm@0
|
219
|
rlm@0
|
220 </div>
|
rlm@0
|
221
|
rlm@0
|
222 <div id="outline-container-4" class="outline-2">
|
rlm@0
|
223 <h2 id="sec-4"><span class="section-number-2">4</span> In Alc/ALc.c : </h2>
|
rlm@0
|
224 <div class="outline-text-2" id="text-4">
|
rlm@0
|
225
|
rlm@0
|
226
|
rlm@0
|
227
|
rlm@0
|
228
|
rlm@0
|
229 <pre class="src src-C"> { <span style="color: #cc9393;">"<your-device>"</span>, alc_<your-device>_init,
|
rlm@0
|
230 alc_<your-device>_deinit, alc_<your-device>_probe, EmptyFuncs },
|
rlm@0
|
231
|
rlm@0
|
232 </pre>
|
rlm@0
|
233
|
rlm@0
|
234
|
rlm@0
|
235
|
rlm@0
|
236
|
rlm@0
|
237 </div>
|
rlm@0
|
238
|
rlm@0
|
239 </div>
|
rlm@0
|
240
|
rlm@0
|
241 <div id="outline-container-5" class="outline-2">
|
rlm@0
|
242 <h2 id="sec-5"><span class="section-number-2">5</span> In CMakeLists.txt </h2>
|
rlm@0
|
243 <div class="outline-text-2" id="text-5">
|
rlm@0
|
244
|
rlm@0
|
245
|
rlm@0
|
246
|
rlm@0
|
247
|
rlm@0
|
248 <pre class="src src-cmake">SET(ALC_OBJS Alc/ALc.c
|
rlm@0
|
249 Alc/ALu.c
|
rlm@0
|
250 Alc/alcConfig.c
|
rlm@0
|
251 Alc/alcDedicated.c
|
rlm@0
|
252 Alc/alcEcho.c
|
rlm@0
|
253 Alc/alcModulator.c
|
rlm@0
|
254 Alc/alcReverb.c
|
rlm@0
|
255 Alc/alcRing.c
|
rlm@0
|
256 Alc/alcThread.c
|
rlm@0
|
257 Alc/bs2b.c
|
rlm@0
|
258 Alc/helpers.c
|
rlm@0
|
259 Alc/hrtf.c
|
rlm@0
|
260 Alc/mixer.c
|
rlm@0
|
261 Alc/panning.c
|
rlm@0
|
262 # Default backends, always available
|
rlm@0
|
263 Alc/backends/loopback.c
|
rlm@0
|
264 Alc/backends/null.c
|
rlm@0
|
265 # : add <your-device> device
|
rlm@0
|
266 Alc/backends/<your-device>.c
|
rlm@0
|
267 )
|
rlm@0
|
268 </pre>
|
rlm@0
|
269
|
rlm@0
|
270
|
rlm@0
|
271
|
rlm@0
|
272
|
rlm@0
|
273
|
rlm@0
|
274 </div>
|
rlm@0
|
275
|
rlm@0
|
276 </div>
|
rlm@0
|
277
|
rlm@0
|
278 <div id="outline-container-6" class="outline-2">
|
rlm@0
|
279 <h2 id="sec-6"><span class="section-number-2">6</span> In ~/.alsoftrc </h2>
|
rlm@0
|
280 <div class="outline-text-2" id="text-6">
|
rlm@0
|
281
|
rlm@0
|
282
|
rlm@0
|
283
|
rlm@0
|
284
|
rlm@0
|
285
|
rlm@0
|
286 <pre class="src src-conf"><span style="color: #f0dfaf;">drivers</span> = <your-device>
|
rlm@0
|
287 </pre>
|
rlm@0
|
288
|
rlm@0
|
289
|
rlm@0
|
290
|
rlm@0
|
291 </div>
|
rlm@0
|
292 </div>
|
rlm@0
|
293 <div id="postamble">
|
rlm@0
|
294 <p class="date">Date: 2011-10-20 15:48:47 MST</p>
|
rlm@0
|
295 <p class="author">Author: Robert McIntyre</p>
|
rlm@0
|
296 <p class="creator">Org version 7.6 with Emacs version 23</p>
|
rlm@0
|
297 <a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
|
rlm@0
|
298 </div>
|
rlm@0
|
299 </div>
|
rlm@0
|
300 </body>
|
rlm@0
|
301 </html>
|