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