diff 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
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/html/add-new-device.html	Tue Oct 25 13:02:31 2011 -0700
     1.3 @@ -0,0 +1,301 @@
     1.4 +<?xml version="1.0" encoding="utf-8"?>
     1.5 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     1.6 +               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
     1.7 +<html xmlns="http://www.w3.org/1999/xhtml"
     1.8 +lang="en" xml:lang="en">
     1.9 +<head>
    1.10 +<title>all the steps to add a device to open-al</title>
    1.11 +<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    1.12 +<meta name="generator" content="Org-mode"/>
    1.13 +<meta name="generated" content="2011-10-20 15:48:47 MST"/>
    1.14 +<meta name="author" content="Robert McIntyre"/>
    1.15 +<meta name="description" content="how to add a new device to open-al"/>
    1.16 +<meta name="keywords" content=""/>
    1.17 +<style type="text/css">
    1.18 + <!--/*--><![CDATA[/*><!--*/
    1.19 +  html { font-family: Times, serif; font-size: 12pt; }
    1.20 +  .title  { text-align: center; }
    1.21 +  .todo   { color: red; }
    1.22 +  .done   { color: green; }
    1.23 +  .tag    { background-color: #add8e6; font-weight:normal }
    1.24 +  .target { }
    1.25 +  .timestamp { color: #bebebe; }
    1.26 +  .timestamp-kwd { color: #5f9ea0; }
    1.27 +  .right  {margin-left:auto; margin-right:0px;  text-align:right;}
    1.28 +  .left   {margin-left:0px;  margin-right:auto; text-align:left;}
    1.29 +  .center {margin-left:auto; margin-right:auto; text-align:center;}
    1.30 +  p.verse { margin-left: 3% }
    1.31 +  pre {
    1.32 +	border: 1pt solid #AEBDCC;
    1.33 +	background-color: #F3F5F7;
    1.34 +	padding: 5pt;
    1.35 +	font-family: courier, monospace;
    1.36 +        font-size: 90%;
    1.37 +        overflow:auto;
    1.38 +  }
    1.39 +  table { border-collapse: collapse; }
    1.40 +  td, th { vertical-align: top;  }
    1.41 +  th.right  { text-align:center;  }
    1.42 +  th.left   { text-align:center;   }
    1.43 +  th.center { text-align:center; }
    1.44 +  td.right  { text-align:right;  }
    1.45 +  td.left   { text-align:left;   }
    1.46 +  td.center { text-align:center; }
    1.47 +  dt { font-weight: bold; }
    1.48 +  div.figure { padding: 0.5em; }
    1.49 +  div.figure p { text-align: center; }
    1.50 +  textarea { overflow-x: auto; }
    1.51 +  .linenr { font-size:smaller }
    1.52 +  .code-highlighted {background-color:#ffff00;}
    1.53 +  .org-info-js_info-navigation { border-style:none; }
    1.54 +  #org-info-js_console-label { font-size:10px; font-weight:bold;
    1.55 +                               white-space:nowrap; }
    1.56 +  .org-info-js_search-highlight {background-color:#ffff00; color:#000000;
    1.57 +                                 font-weight:bold; }
    1.58 +  /*]]>*/-->
    1.59 +</style>
    1.60 +<link rel="stylesheet" type="text/css" href="/aurellem/css/aurellem.css" />
    1.61 +<script type="text/javascript">
    1.62 +<!--/*--><![CDATA[/*><!--*/
    1.63 + function CodeHighlightOn(elem, id)
    1.64 + {
    1.65 +   var target = document.getElementById(id);
    1.66 +   if(null != target) {
    1.67 +     elem.cacheClassElem = elem.className;
    1.68 +     elem.cacheClassTarget = target.className;
    1.69 +     target.className = "code-highlighted";
    1.70 +     elem.className   = "code-highlighted";
    1.71 +   }
    1.72 + }
    1.73 + function CodeHighlightOff(elem, id)
    1.74 + {
    1.75 +   var target = document.getElementById(id);
    1.76 +   if(elem.cacheClassElem)
    1.77 +     elem.className = elem.cacheClassElem;
    1.78 +   if(elem.cacheClassTarget)
    1.79 +     target.className = elem.cacheClassTarget;
    1.80 + }
    1.81 +/*]]>*///-->
    1.82 +</script>
    1.83 +
    1.84 +</head>
    1.85 +<body>
    1.86 +
    1.87 +<div id="content">
    1.88 +
    1.89 +
    1.90 +
    1.91 +<div class="header">
    1.92 +  <div class="float-right">	
    1.93 +    <!-- 
    1.94 +    <form>
    1.95 +      <input type="text"/><input type="submit" value="search the blog &raquo;"/> 
    1.96 +    </form>
    1.97 +    -->
    1.98 +  </div>
    1.99 +
   1.100 +  <h1>aurellem <em>&#x2609;</em></h1>
   1.101 +  <ul class="nav">
   1.102 +    <li><a href="/">read the blog &raquo;</a></li>
   1.103 +    <!-- li><a href="#">learn about us &raquo;</a></li-->
   1.104 +  </ul>
   1.105 +</div>
   1.106 +
   1.107 +<h1 class="title">all the steps to add a device to open-al</h1>
   1.108 +<div class="author">Written by <author>Robert McIntyre</author></div>
   1.109 +
   1.110 +
   1.111 +
   1.112 +
   1.113 +
   1.114 +
   1.115 +
   1.116 +<div id="table-of-contents">
   1.117 +<h2>Table of Contents</h2>
   1.118 +<div id="text-table-of-contents">
   1.119 +<ul>
   1.120 +<li><a href="#sec-1">1 How to add a new backend device </a></li>
   1.121 +<li><a href="#sec-2">2 In Alc/backends/&lt;your-device&gt;.c </a></li>
   1.122 +<li><a href="#sec-3">3 In OpenAL32/Include/alMain.h : </a></li>
   1.123 +<li><a href="#sec-4">4 In Alc/ALc.c : </a></li>
   1.124 +<li><a href="#sec-5">5 In CMakeLists.txt </a></li>
   1.125 +<li><a href="#sec-6">6 In ~/.alsoftrc </a></li>
   1.126 +</ul>
   1.127 +</div>
   1.128 +</div>
   1.129 +
   1.130 +<div id="outline-container-1" class="outline-2">
   1.131 +<h2 id="sec-1"><span class="section-number-2">1</span> How to add a new backend device </h2>
   1.132 +<div class="outline-text-2" id="text-1">
   1.133 +
   1.134 +
   1.135 +</div>
   1.136 +
   1.137 +</div>
   1.138 +
   1.139 +<div id="outline-container-2" class="outline-2">
   1.140 +<h2 id="sec-2"><span class="section-number-2">2</span> In Alc/backends/&lt;your-device&gt;.c </h2>
   1.141 +<div class="outline-text-2" id="text-2">
   1.142 +
   1.143 +
   1.144 +
   1.145 +
   1.146 +
   1.147 +<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;;
   1.148 +
   1.149 +<span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> <span style="color: #f0dfaf;">alc_</span>&lt;your-device&gt;_init(BackendFuncs *func_list)
   1.150 +<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>)
   1.151 +
   1.152 +<span style="color: #f0dfaf; font-weight: bold;">static</span> <span style="color: #dfdfbf; font-weight: bold;">ALCboolean</span> &lt;your-device&gt;_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>)
   1.153 +<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)
   1.154 +<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)
   1.155 +<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)
   1.156 +</pre>
   1.157 +
   1.158 +
   1.159 +
   1.160 +
   1.161 +
   1.162 +<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>)
   1.163 +{
   1.164 +    <span style="color: #f0dfaf; font-weight: bold;">switch</span>(type)
   1.165 +    {
   1.166 +        <span style="color: #f0dfaf; font-weight: bold;">case</span> DEVICE_PROBE:
   1.167 +            AppendDeviceList(&lt;your-device&gt;Device);
   1.168 +            <span style="color: #f0dfaf; font-weight: bold;">break</span>;
   1.169 +        <span style="color: #f0dfaf; font-weight: bold;">case</span> ALL_DEVICE_PROBE:
   1.170 +            AppendAllDeviceList(&lt;your-device&gt;Device);
   1.171 +            <span style="color: #f0dfaf; font-weight: bold;">break</span>;
   1.172 +        <span style="color: #f0dfaf; font-weight: bold;">case</span> CAPTURE_DEVICE_PROBE:
   1.173 +            <span style="color: #f0dfaf; font-weight: bold;">break</span>;
   1.174 +    }
   1.175 +}
   1.176 +</pre>
   1.177 +
   1.178 +
   1.179 +
   1.180 +
   1.181 +
   1.182 +<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 = {
   1.183 +    &lt;your-device&gt;_open_playback,
   1.184 +    &lt;your-device&gt;_close_playback,
   1.185 +    &lt;your-device&gt;_reset_playback,
   1.186 +    &lt;your-device&gt;_stop_playback,
   1.187 +    <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
   1.188 +    <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
   1.189 +    <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
   1.190 +    <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
   1.191 +    <span style="color: #dca3a3; font-weight: bold;">NULL</span>,
   1.192 +    <span style="color: #dca3a3; font-weight: bold;">NULL</span>
   1.193 +};
   1.194 +</pre>
   1.195 +
   1.196 +
   1.197 +
   1.198 +
   1.199 +
   1.200 +</div>
   1.201 +
   1.202 +</div>
   1.203 +
   1.204 +<div id="outline-container-3" class="outline-2">
   1.205 +<h2 id="sec-3"><span class="section-number-2">3</span> In OpenAL32/Include/alMain.h : </h2>
   1.206 +<div class="outline-text-2" id="text-3">
   1.207 +
   1.208 +
   1.209 +
   1.210 +
   1.211 +
   1.212 +<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);
   1.213 +<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>);
   1.214 +<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>);
   1.215 +
   1.216 +</pre>
   1.217 +
   1.218 +
   1.219 +
   1.220 +
   1.221 +</div>
   1.222 +
   1.223 +</div>
   1.224 +
   1.225 +<div id="outline-container-4" class="outline-2">
   1.226 +<h2 id="sec-4"><span class="section-number-2">4</span> In Alc/ALc.c : </h2>
   1.227 +<div class="outline-text-2" id="text-4">
   1.228 +
   1.229 +
   1.230 +
   1.231 +
   1.232 +<pre class="src src-C">     { <span style="color: #cc9393;">"&lt;your-device&gt;"</span>, alc_&lt;your-device&gt;_init, 
   1.233 +         alc_&lt;your-device&gt;_deinit, alc_&lt;your-device&gt;_probe, EmptyFuncs },
   1.234 +
   1.235 +</pre>
   1.236 +
   1.237 +
   1.238 +
   1.239 +
   1.240 +</div>
   1.241 +
   1.242 +</div>
   1.243 +
   1.244 +<div id="outline-container-5" class="outline-2">
   1.245 +<h2 id="sec-5"><span class="section-number-2">5</span> In CMakeLists.txt </h2>
   1.246 +<div class="outline-text-2" id="text-5">
   1.247 +
   1.248 +
   1.249 +
   1.250 +
   1.251 +<pre class="src src-cmake">SET(ALC_OBJS  Alc/ALc.c
   1.252 +              Alc/ALu.c
   1.253 +              Alc/alcConfig.c
   1.254 +              Alc/alcDedicated.c
   1.255 +              Alc/alcEcho.c
   1.256 +              Alc/alcModulator.c
   1.257 +              Alc/alcReverb.c
   1.258 +              Alc/alcRing.c
   1.259 +              Alc/alcThread.c
   1.260 +              Alc/bs2b.c
   1.261 +              Alc/helpers.c
   1.262 +              Alc/hrtf.c
   1.263 +              Alc/mixer.c
   1.264 +              Alc/panning.c
   1.265 +              # Default backends, always available
   1.266 +              Alc/backends/loopback.c
   1.267 +              Alc/backends/null.c
   1.268 +              # : add &lt;your-device&gt; device
   1.269 +              Alc/backends/&lt;your-device&gt;.c
   1.270 +)
   1.271 +</pre>
   1.272 +
   1.273 +
   1.274 +
   1.275 +
   1.276 +
   1.277 +</div>
   1.278 +
   1.279 +</div>
   1.280 +
   1.281 +<div id="outline-container-6" class="outline-2">
   1.282 +<h2 id="sec-6"><span class="section-number-2">6</span> In ~/.alsoftrc </h2>
   1.283 +<div class="outline-text-2" id="text-6">
   1.284 +
   1.285 +
   1.286 +
   1.287 +
   1.288 +
   1.289 +<pre class="src src-conf"><span style="color: #f0dfaf;">drivers</span> = &lt;your-device&gt;
   1.290 +</pre>
   1.291 +
   1.292 +
   1.293 +
   1.294 +</div>
   1.295 +</div>
   1.296 +<div id="postamble">
   1.297 +<p class="date">Date: 2011-10-20 15:48:47 MST</p>
   1.298 +<p class="author">Author: Robert McIntyre</p>
   1.299 +<p class="creator">Org version 7.6 with Emacs version 23</p>
   1.300 +<a href="http://validator.w3.org/check?uri=referer">Validate XHTML 1.0</a>
   1.301 +</div>
   1.302 +</div>
   1.303 +</body>
   1.304 +</html>