view html/add-new-device.html @ 33:3caceef436ea tip

formatting for web
author Robert McIntyre <rlm@mit.edu>
date Sat, 11 Feb 2012 12:25:55 -0700
parents f9476ff7637e
children
line wrap: on
line source
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" lang="en" xml:lang="en">
5 <head>
6 <title>Steps to add a new Device to Open-AL</title>
7 <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
8 <meta name="title" content="Steps to add a new Device to Open-AL"/>
9 <meta name="generator" content="Org-mode"/>
10 <meta name="generated" content="2012-02-11 04:43:24 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 div.inlinetask {
48 padding:10px;
49 border:2px solid gray;
50 margin:10px;
51 background: #ffffcc;
52 }
53 textarea { overflow-x: auto; }
54 .linenr { font-size:smaller }
55 .code-highlighted {background-color:#ffff00;}
56 .org-info-js_info-navigation { border-style:none; }
57 #org-info-js_console-label { font-size:10px; font-weight:bold;
58 white-space:nowrap; }
59 .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
60 font-weight:bold; }
61 /*]]>*/-->
62 </style>
63 <link rel="stylesheet" type="text/css" href="/aurellem/css/aurellem.css" />
64 <script type="text/javascript">
65 <!--/*--><![CDATA[/*><!--*/
66 function CodeHighlightOn(elem, id)
67 {
68 var target = document.getElementById(id);
69 if(null != target) {
70 elem.cacheClassElem = elem.className;
71 elem.cacheClassTarget = target.className;
72 target.className = "code-highlighted";
73 elem.className = "code-highlighted";
74 }
75 }
76 function CodeHighlightOff(elem, id)
77 {
78 var target = document.getElementById(id);
79 if(elem.cacheClassElem)
80 elem.className = elem.cacheClassElem;
81 if(elem.cacheClassTarget)
82 target.className = elem.cacheClassTarget;
83 }
84 /*]]>*///-->
85 </script>
87 </head>
88 <body>
91 <div id="content">
92 <h1 class="title">Steps to add a new Device to Open-AL</h1>
95 <div class="header">
96 <div class="float-right">
97 <!--
98 <form>
99 <input type="text"/><input type="submit" value="search the blog &raquo;"/>
100 </form>
101 -->
102 </div>
104 <h1>aurellem <em>&#x2609;</em></h1>
105 <ul class="nav">
106 <li><a href="/">read the blog &raquo;</a></li>
107 <!-- li><a href="#">learn about us &raquo;</a></li-->
108 </ul>
109 </div>
111 <div class="author">Written by <author>Robert McIntyre</author></div>
119 <div id="table-of-contents">
120 <h2>Table of Contents</h2>
121 <div id="text-table-of-contents">
122 <ul>
123 <li><a href="#sec-1">1 In Alc/backends/&lt;your-device&gt;.c</a></li>
124 <li><a href="#sec-2">2 In OpenAL32/Include/alMain.h :</a></li>
125 <li><a href="#sec-3">3 In Alc/ALc.c :</a></li>
126 <li><a href="#sec-4">4 In CMakeLists.txt</a></li>
127 <li><a href="#sec-5">5 In ~/.alsoftrc</a></li>
128 </ul>
129 </div>
130 </div>
132 <div id="outline-container-1" class="outline-2">
133 <h2 id="sec-1"><span class="section-number-2">1</span> In Alc/backends/&lt;your-device&gt;.c</h2>
134 <div class="outline-text-2" id="text-1">
140 <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> &lt;your-device&gt;_device[] = &lt;your-device-name&gt;;
142 <span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> <span style="color: #f0dfaf;">alc_</span>&lt;your-device&gt;_init(BackendFuncs *func_list)
143 <span style="color: #dfdfbf; font-weight: bold;">void</span> <span style="color: #f0dfaf;">alc_</span>&lt;your-device&gt;_deinit(<span style="color: #dfdfbf; font-weight: bold;">void</span>)
145 <span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> &lt;your-device&gt;_open_playback
146 (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>)
147 <span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">void</span> &lt;your-device&gt;_close_playback(ALCdevice *device)
148 <span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> &lt;your-device&gt;_reset_playback(ALCdevice *device)
149 <span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">void</span> &lt;your-device&gt;_stop_playback(ALCdevice *device)
151 </pre>
155 <pre class="src src-C"><span style="color: #dfdfbf; font-weight: bold;">void</span> <span style="color: #f0dfaf;">alc_</span>&lt;your-device&gt;_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>)
156 {
157 <span style="color: #f0dfaf; font-weight: bold;">switch</span>(type)
158 {
159 <span style="color: #f0dfaf; font-weight: bold;">case</span> DEVICE_PROBE:
160 AppendDeviceList(&lt;your-device&gt;Device);
161 <span style="color: #f0dfaf; font-weight: bold;">break</span>;
162 <span style="color: #f0dfaf; font-weight: bold;">case</span> ALL_DEVICE_PROBE:
163 AppendAllDeviceList(&lt;your-device&gt;Device);
164 <span style="color: #f0dfaf; font-weight: bold;">break</span>;
165 <span style="color: #f0dfaf; font-weight: bold;">case</span> CAPTURE_DEVICE_PROBE:
166 <span style="color: #f0dfaf; font-weight: bold;">break</span>;
167 }
168 }
169 </pre>
173 <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> &lt;your-device&gt;_funcs = {
174 &lt;your-device&gt;_open_playback,
175 &lt;your-device&gt;_close_playback,
176 &lt;your-device&gt;_reset_playback,
177 &lt;your-device&gt;_stop_playback,
178 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
179 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
180 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
181 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
182 <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
183 <span style="color: #dca3a3; font-weight: bold;">NULL</span>
184 };
185 </pre>
189 </div>
191 </div>
193 <div id="outline-container-2" class="outline-2">
194 <h2 id="sec-2"><span class="section-number-2">2</span> In OpenAL32/Include/alMain.h :</h2>
195 <div class="outline-text-2" id="text-2">
201 <pre class="src src-C"><span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> <span style="color: #f0dfaf;">alc_</span>&lt;your-device&gt;_init(BackendFuncs *func_list);
202 <span style="color: #dfdfbf; font-weight: bold;">void</span> <span style="color: #f0dfaf;">alc_</span>&lt;your-device&gt;_deinit(<span style="color: #dfdfbf; font-weight: bold;">void</span>);
203 <span style="color: #dfdfbf; font-weight: bold;">void</span> <span style="color: #f0dfaf;">alc_</span>&lt;your-device&gt;_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>);
205 </pre>
208 </div>
210 </div>
212 <div id="outline-container-3" class="outline-2">
213 <h2 id="sec-3"><span class="section-number-2">3</span> In Alc/ALc.c :</h2>
214 <div class="outline-text-2" id="text-3">
219 <pre class="src src-C"> { <span style="color: #cc9393;">"&lt;your-device&gt;"</span>, alc_&lt;your-device&gt;_init,
220 alc_&lt;your-device&gt;_deinit, alc_&lt;your-device&gt;_probe, EmptyFuncs },
222 </pre>
225 </div>
227 </div>
229 <div id="outline-container-4" class="outline-2">
230 <h2 id="sec-4"><span class="section-number-2">4</span> In CMakeLists.txt</h2>
231 <div class="outline-text-2" id="text-4">
236 <pre class="src src-cmake">SET(ALC_OBJS Alc/ALc.c
237 Alc/ALu.c
238 Alc/alcConfig.c
239 Alc/alcDedicated.c
240 Alc/alcEcho.c
241 Alc/alcModulator.c
242 Alc/alcReverb.c
243 Alc/alcRing.c
244 Alc/alcThread.c
245 Alc/bs2b.c
246 Alc/helpers.c
247 Alc/hrtf.c
248 Alc/mixer.c
249 Alc/panning.c
250 # Default backends, always available
251 Alc/backends/loopback.c
252 Alc/backends/null.c
253 # : add &lt;your-device&gt; herex
254 Alc/backends/&lt;your-device&gt;.c
255 )
256 </pre>
260 </div>
262 </div>
264 <div id="outline-container-5" class="outline-2">
265 <h2 id="sec-5"><span class="section-number-2">5</span> In ~/.alsoftrc</h2>
266 <div class="outline-text-2" id="text-5">
272 <pre class="src src-conf"><span style="color: #f0dfaf;">drivers</span> = &lt;your-device&gt;
273 </pre>
275 </div>
276 </div>
277 </div>
279 <div id="postamble">
280 <p class="date">Date: 2012-02-11 04:43:24 MST</p>
281 <p class="author">Author: Robert McIntyre</p>
282 <p class="creator">Org version 7.7 with Emacs version 23</p>
283 <a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
285 </div>
286 </body>
287 </html>